Class StateManager
- Namespace
- RandomizerCore.Logic.StateLogic
- Assembly
- RandomizerCore.dll
Object which manages the list of fields which State should represent.
public class StateManager
- Inheritance
-
StateManager
- Inherited Members
Constructors
StateManager(StateManagerBuilder)
public StateManager(StateManagerBuilder builder)
Parameters
builder
StateManagerBuilder
Fields
DefaultState
public readonly State DefaultState
Field Value
DefaultStateSingleton
public readonly StateUnion DefaultStateSingleton
Field Value
Empty
public readonly StateUnion Empty
Field Value
Properties
Bools
public ReadOnlyCollection<StateBool> Bools { get; }
Property Value
FieldLookup
public ReadOnlyDictionary<string, StateField> FieldLookup { get; }
Property Value
FieldProperties
public ReadOnlyDictionary<string, ReadOnlyDictionary<string, object?>> FieldProperties { get; }
Property Value
Ints
public ReadOnlyCollection<StateInt> Ints { get; }
Property Value
NamedStateUnions
public ReadOnlyDictionary<string, StateUnion> NamedStateUnions { get; }
Property Value
NamedStates
public ReadOnlyDictionary<string, State> NamedStates { get; }
Property Value
Methods
GetBool(string)
Fetches the state bool by name. Returns null if not defined.
public StateBool? GetBool(string name)
Parameters
name
string
Returns
GetBoolStrict(string)
Fetches the state bool by name.
public StateBool GetBoolStrict(string name)
Parameters
name
string
Returns
Exceptions
- ArgumentException
The state bool is not defined.
GetFieldDefs()
public Dictionary<string, List<string>> GetFieldDefs()
Returns
GetInt(string)
Fetches the state int by name. Returns null if not defined.
public StateInt? GetInt(string name)
Parameters
name
string
Returns
GetIntStrict(string)
Fetches the state int by name.
public StateInt GetIntStrict(string name)
Parameters
name
string
Returns
Exceptions
- ArgumentException
The state int is not defined.
GetNamedState(string)
public State? GetNamedState(string name)
Parameters
name
string
Returns
GetNamedStateStrict(string)
public State GetNamedStateStrict(string name)
Parameters
name
string
Returns
GetNamedStateUnion(string)
public StateUnion? GetNamedStateUnion(string name)
Parameters
name
string
Returns
GetNamedStateUnionStrict(string)
public StateUnion GetNamedStateUnionStrict(string name)
Parameters
name
string
Returns
GetProperty(string, string)
Returns the value of the property for the field, if defined, or else null.
public object? GetProperty(string fieldName, string propertyName)
Parameters
Returns
HasProperty(string, string)
Returns true if the property for the field is defined and not null.
public bool HasProperty(string fieldName, string propertyName)
Parameters
Returns
PrettyPrint(StateUnion?)
public string PrettyPrint(StateUnion? states)
Parameters
states
StateUnion
Returns
PrettyPrint<T>(T)
public string PrettyPrint<T>(T state) where T : IState
Parameters
state
T
Returns
Type Parameters
T