Class GameData<TValue>
Stores per-game variables.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: SlugBase.Features
Assembly: SlugBase.dll
Syntax
public class GameData<TValue> : Data<RainWorldGame, TValue> where TValue : new()
Type Parameters
Name | Description |
---|---|
TValue | The type of data stored. |
Constructors
GameData(Feature)
Create a new per-game variable that depends on requiredFeature
.
Declaration
public GameData(Feature requiredFeature)
Parameters
Type | Name | Description |
---|---|---|
Feature | requiredFeature | The required Feature, or |
Methods
Get(RainWorldGame)
Gets the TValue
instance assocated with game
, constructing it if it does not exist.
If the game's SlugBaseCharacter does not have RequiredFeature, then null
is returned.
Declaration
public StrongBox<TValue> Get(RainWorldGame game)
Parameters
Type | Name | Description |
---|---|---|
RainWorldGame | game | The current game. |
Returns
Type | Description |
---|---|
System.Runtime.CompilerServices.StrongBox<TValue> |
TryGet(RainWorldGame, out TValue)
Gets the TValue
instance assocated with game
, constructing it if it does not exist.
Declaration
public bool TryGet(RainWorldGame game, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
RainWorldGame | game | The current game. |
TValue | value | The stored value, or |
Returns
Type | Description |
---|---|
System.Boolean |
|