Class LogicManagerBuilder
- Namespace
- RandomizerCore.Logic
- Assembly
- RandomizerCore.dll
public class LogicManagerBuilder
- Inheritance
-
LogicManagerBuilder
- Inherited Members
Constructors
LogicManagerBuilder()
public LogicManagerBuilder()
LogicManagerBuilder(LogicManager)
public LogicManagerBuilder(LogicManager source)
Parameters
source
LogicManager
LogicManagerBuilder(LogicManagerBuilder)
public LogicManagerBuilder(LogicManagerBuilder source)
Parameters
source
LogicManagerBuilder
Fields
ItemLookup
public readonly Dictionary<string, ILogicItemTemplate> ItemLookup
Field Value
LogicLookup
public readonly Dictionary<string, LogicClause> LogicLookup
Field Value
Terms
public readonly TermCollectionBuilder Terms
Field Value
Transitions
public readonly HashSet<string> Transitions
Field Value
Waypoints
public readonly HashSet<string> Waypoints
Field Value
Properties
LP
public LogicProcessor LP { get; set; }
Property Value
VariableResolver
public VariableResolver VariableResolver { get; set; }
Property Value
Methods
AddItem(LogicItem)
public void AddItem(LogicItem item)
Parameters
item
LogicItem
AddItem(ILogicItemTemplate)
Adds the item template to the builder's dictionary. Overwrites any existing item with the same name.
public void AddItem(ILogicItemTemplate item)
Parameters
item
ILogicItemTemplate
AddLogicDef(RawLogicDef)
Adds the RawLogicDef for general use. Overwrites any existing logic with the same name.
public void AddLogicDef(RawLogicDef def)
Parameters
def
RawLogicDef
AddTransition(RawLogicDef)
Adds the RawLogicTransition as a new transition. Overwrites any existing logic with the same name.
public void AddTransition(RawLogicDef def)
Parameters
def
RawLogicDef
AddWaypoint(RawWaypointDef)
Adds the RawLogicDef as a new waypoint. Overwrites any existing logic with the same name.
public void AddWaypoint(RawWaypointDef def)
Parameters
def
RawWaypointDef
DeserializeFile(LogicFileType, ILogicFormat, Stream)
public void DeserializeFile(LogicFileType type, ILogicFormat logicFormat, Stream s)
Parameters
type
LogicFileTypelogicFormat
ILogicFormats
Stream
DoLogicEdit(RawLogicDef)
If the input contains the ORIG token and the logic def is already defined, substitutes the old value for ORIG in the input, and overwrites the old logic.
If the input does not contain the ORIG token, is equivalent to AddLogicDef.
public void DoLogicEdit(RawLogicDef def)
Parameters
def
RawLogicDef
DoMacroEdit(KeyValuePair<string, string>)
If the input contains the ORIG token and the macro is already defined, substitutes the old value for ORIG in the input, and overwrites the old macro.
If the input does not contain the ORIG token, is equivalent to LP.SetMacro.
public void DoMacroEdit(KeyValuePair<string, string> kvp)
Parameters
kvp
KeyValuePair<string, string>
DoSubst(RawSubstDef)
Performs the requested substitution on the named logic def or macro.
public void DoSubst(RawSubstDef def)
Parameters
def
RawSubstDef
GetOrAddTerm(string)
If the string is a key in the term lookup, returns the corresponding term. Otherwise, creates, saves, and returns a new term, of Byte type.
public Term GetOrAddTerm(string value)
Parameters
value
string
Returns
GetOrAddTerm(string, TermType)
If the string is a key in the term lookup, returns the corresponding term. Otherwise, creates, saves, and returns a new term of the given type.
public Term GetOrAddTerm(string value, TermType type)
Parameters
Returns
Exceptions
- InvalidOperationException
The term has been defined with a different type.
GetTerm(int)
public Term GetTerm(int id)
Parameters
id
int
Returns
GetTerm(string)
public Term GetTerm(string term)
Parameters
term
string
Returns
IsTerm(string)
Returns whether the string is a key in the term lookup.
public bool IsTerm(string value)
Parameters
value
string
Returns
LoadData(LogicFileType, object?)
Applies the data to the LMB. The type of the data should match the output of ILogicFormat for the given LogicFileType.
public void LoadData(LogicFileType type, object? data)
Parameters
type
LogicFileTypedata
object