Table of Contents

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

State

DefaultStateSingleton

public readonly StateUnion DefaultStateSingleton

Field Value

StateUnion

Empty

public readonly StateUnion Empty

Field Value

StateUnion

Properties

Bools

public ReadOnlyCollection<StateBool> Bools { get; }

Property Value

ReadOnlyCollection<StateBool>

FieldLookup

public ReadOnlyDictionary<string, StateField> FieldLookup { get; }

Property Value

ReadOnlyDictionary<string, StateField>

FieldProperties

public ReadOnlyDictionary<string, ReadOnlyDictionary<string, object?>> FieldProperties { get; }

Property Value

ReadOnlyDictionary<string, ReadOnlyDictionary<string, object>>

Ints

public ReadOnlyCollection<StateInt> Ints { get; }

Property Value

ReadOnlyCollection<StateInt>

NamedStateUnions

public ReadOnlyDictionary<string, StateUnion> NamedStateUnions { get; }

Property Value

ReadOnlyDictionary<string, StateUnion>

NamedStates

public ReadOnlyDictionary<string, State> NamedStates { get; }

Property Value

ReadOnlyDictionary<string, State>

Methods

GetBool(string)

Fetches the state bool by name. Returns null if not defined.

public StateBool? GetBool(string name)

Parameters

name string

Returns

StateBool

GetBoolStrict(string)

Fetches the state bool by name.

public StateBool GetBoolStrict(string name)

Parameters

name string

Returns

StateBool

Exceptions

ArgumentException

The state bool is not defined.

GetFieldDefs()

public Dictionary<string, List<string>> GetFieldDefs()

Returns

Dictionary<string, List<string>>

GetInt(string)

Fetches the state int by name. Returns null if not defined.

public StateInt? GetInt(string name)

Parameters

name string

Returns

StateInt

GetIntStrict(string)

Fetches the state int by name.

public StateInt GetIntStrict(string name)

Parameters

name string

Returns

StateInt

Exceptions

ArgumentException

The state int is not defined.

GetNamedState(string)

public State? GetNamedState(string name)

Parameters

name string

Returns

State

GetNamedStateStrict(string)

public State GetNamedStateStrict(string name)

Parameters

name string

Returns

State

GetNamedStateUnion(string)

public StateUnion? GetNamedStateUnion(string name)

Parameters

name string

Returns

StateUnion

GetNamedStateUnionStrict(string)

public StateUnion GetNamedStateUnionStrict(string name)

Parameters

name string

Returns

StateUnion

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

fieldName string
propertyName string

Returns

object

HasProperty(string, string)

Returns true if the property for the field is defined and not null.

public bool HasProperty(string fieldName, string propertyName)

Parameters

fieldName string
propertyName string

Returns

bool

PrettyPrint(StateUnion?)

public string PrettyPrint(StateUnion? states)

Parameters

states StateUnion

Returns

string

PrettyPrint<T>(T)

public string PrettyPrint<T>(T state) where T : IState

Parameters

state T

Returns

string

Type Parameters

T