Table of Contents

Class StateLogicDef

Namespace
RandomizerCore.Logic.StateLogic
Assembly
RandomizerCore.dll

A LogicDef which also supports state calculation.

public abstract class StateLogicDef : LogicDef, ILogicDef
Inheritance
StateLogicDef
Implements
Derived
Inherited Members

Constructors

StateLogicDef(string, string)

public StateLogicDef(string name, string infixSource)

Parameters

name string
infixSource string

Methods

CheckForUpdatedState(ProgressionManager, StateUnion?, List<State>, out StateUnion)

Runs EvaluateState, and returns true if any new states are added to the state union, or if current is null and the result is empty.

public virtual bool CheckForUpdatedState(ProgressionManager pm, StateUnion? current, List<State> accumulator, out StateUnion result)

Parameters

pm ProgressionManager
current StateUnion
accumulator List<State>
result StateUnion

Returns

bool

CheckForUpdatedState(ProgressionManager, StateUnion?, List<State>, int, out StateUnion)

Runs EvaluateState, and returns true if any new states are added to the state union.

public virtual bool CheckForUpdatedState(ProgressionManager pm, StateUnion? current, List<State> accumulator, int modifiedTerm, out StateUnion result)

Parameters

pm ProgressionManager
current StateUnion
accumulator List<State>
modifiedTerm int
result StateUnion

Returns

bool

EvaluateState(ProgressionManager, List<State>)

Uses the current progression data to determine under what state(s) the logic is satisfiable.
Appends a (possibly empty, non-reduced) sequence of result states to the input list. Returns true if the result is nonempty, or the result is empty but represents a nonnull indeterminate result.

public abstract bool EvaluateState(ProgressionManager pm, List<State> result)

Parameters

pm ProgressionManager
result List<State>

Returns

bool

EvaluateStateFrom(ProgressionManager, IStateProvider, List<State>)

Uses the current progression data what state(s) the logic is satisfiable, only allowing input states from the given state provider (recognized by reference equality).

public abstract bool EvaluateStateFrom(ProgressionManager pm, IStateProvider stateProvider, List<State> result)

Parameters

pm ProgressionManager
stateProvider IStateProvider
result List<State>

Returns

bool

GetStateProviders()

Gets a sequence of unique state providers the LogicDef may depend on, for use with EvaluateStateFrom(ProgressionManager, IStateProvider, List<State>).

public abstract IEnumerable<IStateProvider> GetStateProviders()

Returns

IEnumerable<IStateProvider>