DocFX + Singulink = ♥

Class GameData<TValue>

Stores per-game variables.

Inheritance
object
Data
Data<RainWorldGame, TValue>
GameData<TValue>
Inherited Members
Data<RainWorldGame, TValue>.Get(SlugBaseCharacter, RainWorldGame)
Data.TryUnbox<T>(StrongBox<T>, out T)
Data.RequiredFeature
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
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

View Source

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 null if data access should not be locked behind a feature.

Methods

View Source

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
StrongBox<TValue>
View Source

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 TValue's default value if the required feature wasn't found.

Returns
Type Description
bool

true if game had RequiredFeature, false otherwise.