Table of Contents

Class StateBuilder

Namespace
RandomizerCore.Logic.StateLogic
Assembly
RandomizerCore.dll

Object used to create State.

public class StateBuilder : IState
Inheritance
StateBuilder
Implements
Inherited Members

Constructors

StateBuilder(State)

public StateBuilder(State state)

Parameters

state State

StateBuilder(StateBuilder)

public StateBuilder(StateBuilder state)

Parameters

state StateBuilder

StateBuilder(StateManager)

public StateBuilder(StateManager sm)

Parameters

sm StateManager

StateBuilder(int, int)

public StateBuilder(int bools, int ints)

Parameters

bools int
ints int

Methods

CloneBools()

public RCBitArray CloneBools()

Returns

RCBitArray

CloneInts()

public int[] CloneInts()

Returns

int[]

Destruct(out RCBitArray, out int[])

Exposes the data of the StateBuilder, and renders it incapable of further modification.

public void Destruct(out RCBitArray bools, out int[] ints)

Parameters

bools RCBitArray
ints int[]

Exceptions

InvalidOperationException

The StateBuilder has already been destructed.

GetBool(int)

public bool GetBool(int id)

Parameters

id int

Returns

bool

GetInt(int)

public int GetInt(int id)

Parameters

id int

Returns

int

Increment(int, int)

Increments the specified field.

public void Increment(int id, int incr)

Parameters

id int
incr int

IsComparablyLE(State)

public bool IsComparablyLE(State other)

Parameters

other State

Returns

bool

IsComparablyLE(State, StateBuilder)

public static bool IsComparablyLE(State left, StateBuilder right)

Parameters

left State
right StateBuilder

Returns

bool

IsComparablyLE(StateBuilder, State)

public static bool IsComparablyLE(StateBuilder left, State right)

Parameters

left StateBuilder
right State

Returns

bool

IsComparablyLE(StateBuilder, StateBuilder)

public static bool IsComparablyLE(StateBuilder left, StateBuilder right)

Parameters

left StateBuilder
right StateBuilder

Returns

bool

SetBool(int, bool)

Sets the specified field.

public void SetBool(int id, bool value)

Parameters

id int
value bool

SetInt(int, int)

Sets the specified field.

public void SetInt(int id, int value)

Parameters

id int
value int

TryIncrement(int, int, int)

Returns false if the increment would cause the field to exceed the max value. Otherwise, performs Increment(int, int) and returns true.

public bool TryIncrement(int id, int incr, int maxValue)

Parameters

id int
incr int
maxValue int

Returns

bool

TrySetBoolTrue(int)

If the field is false, sets it true and returns true. Otherwise, returns false.

public bool TrySetBoolTrue(int id)

Parameters

id int

Returns

bool

TrySetIntToValue(int, int)

Returns false if value is less than the field value. Otherwise, performs SetInt(int, int) and returns true.

public bool TrySetIntToValue(int id, int value)

Parameters

id int
value int

Returns

bool