Class LogicManager
- Namespace
- RandomizerCore.Logic
- Assembly
- RandomizerCore.dll
public class LogicManager
- Inheritance
-
LogicManager
- Inherited Members
Constructors
LogicManager(LogicManagerBuilder)
public LogicManager(LogicManagerBuilder source)
Parameters
source
LogicManagerBuilder
Fields
ItemLookup
public readonly ReadOnlyDictionary<string, LogicItem> ItemLookup
Field Value
LogicLookup
public readonly ReadOnlyDictionary<string, LogicDef> LogicLookup
Field Value
StateManager
public readonly StateManager StateManager
Field Value
Terms
public readonly TermCollection Terms
Field Value
TransitionLookup
public readonly ReadOnlyDictionary<string, LogicTransition> TransitionLookup
Field Value
Variables
public readonly ReadOnlyCollection<LogicVariable> Variables
Field Value
Waypoints
public readonly ReadOnlyCollection<LogicWaypoint> Waypoints
Field Value
intVariableOffset
public const int intVariableOffset = -100
Field Value
Properties
LP
public LogicProcessor LP { get; }
Property Value
VariableResolver
public VariableResolver VariableResolver { get; }
Property Value
Methods
CreateDNFLogicDef(RawLogicDef)
public DNFLogicDef CreateDNFLogicDef(RawLogicDef def)
Parameters
def
RawLogicDef
Returns
CreateDNFLogicDef(string, LogicClause)
public DNFLogicDef CreateDNFLogicDef(string name, LogicClause tokens)
Parameters
name
stringtokens
LogicClause
Returns
CreateRPNLogicDef(RawLogicDef)
public RPNLogicDef CreateRPNLogicDef(RawLogicDef def)
Parameters
def
RawLogicDef
Returns
CreateSingleStateLogic(RawLogicDef)
Parses infix logic which should take progression data and a single state as input.
public SingleStateLogic CreateSingleStateLogic(RawLogicDef def)
Parameters
def
RawLogicDef
Returns
CreateSingleStateLogic(string, LogicClause)
public SingleStateLogic CreateSingleStateLogic(string name, LogicClause c)
Parameters
name
stringc
LogicClause
Returns
FromItemString(string, string)
public LogicItem FromItemString(string name, string itemDef)
Parameters
Returns
FromString(RawLogicDef)
public LogicDef FromString(RawLogicDef def)
Parameters
def
RawLogicDef
Returns
FromTokens(string, LogicClause)
[Obsolete]
public RPNLogicDef FromTokens(string name, LogicClause c)
Parameters
name
stringc
LogicClause
Returns
GetItem(string)
Fetches the logic item by name. Returns null if not defined.
public LogicItem? GetItem(string name)
Parameters
name
string
Returns
GetItemStrict(string)
Fetches the logic item by name.
public LogicItem GetItemStrict(string name)
Parameters
name
string
Returns
Exceptions
- ArgumentException
The logic item is not defined.
GetLogicDef(string)
Fetches the logic def by name. Returns null if not defined.
public LogicDef? GetLogicDef(string name)
Parameters
name
string
Returns
GetLogicDefStrict(string)
Fetches the logic def by name.
public LogicDef GetLogicDefStrict(string name)
Parameters
name
string
Returns
Exceptions
- ArgumentException
The logic def is not defined.
GetTerm(int)
Fetches the term by its id.
public Term GetTerm(int id)
Parameters
id
int
Returns
GetTerm(string)
Fetches the term by name. Returns null if not defined.
public Term? GetTerm(string item)
Parameters
item
string
Returns
GetTermStrict(string)
Fetches the term by name.
public Term GetTermStrict(string item)
Parameters
item
string
Returns
Exceptions
- ArgumentException
The tern is not defined.
GetTransition(string)
Fetches the logic transition by name. Returns null if not defined.
public LogicTransition? GetTransition(string name)
Parameters
name
string
Returns
GetTransitionStrict(string)
Fetches the logic transition by name.
public LogicTransition GetTransitionStrict(string name)
Parameters
name
string
Returns
Exceptions
- ArgumentException
The logic transition is not defined.
GetVariable(int)
Fetches the variable by its id.
public LogicVariable GetVariable(int id)
Parameters
id
int
Returns
GetVariable(string)
Fetches the variable by name. If the variable has not yet been instantiated, caches it and gives it an id. Returns null if the name cannot be resolved to a variable.
public LogicVariable? GetVariable(string name)
Parameters
name
string
Returns
GetVariableStrict(string)
Fetches the variable by name. If the variable has not yet been instantiated, caches it and gives it an id.
public LogicVariable GetVariableStrict(string name)
Parameters
name
string
Returns
Exceptions
- ArgumentException
The name cannot be resolved to a variable.
IsTermOrVariable(string)
public bool IsTermOrVariable(string name)
Parameters
name
string