Table of Contents

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

Dictionary<string, ILogicItemTemplate>

LogicLookup

public readonly Dictionary<string, LogicClause> LogicLookup

Field Value

Dictionary<string, LogicClause>

Terms

public readonly TermCollectionBuilder Terms

Field Value

TermCollectionBuilder

Transitions

public readonly HashSet<string> Transitions

Field Value

HashSet<string>

Waypoints

public readonly HashSet<string> Waypoints

Field Value

HashSet<string>

Properties

LP

public LogicProcessor LP { get; set; }

Property Value

LogicProcessor

VariableResolver

public VariableResolver VariableResolver { get; set; }

Property Value

VariableResolver

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 LogicFileType
logicFormat ILogicFormat
s 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

Term

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

value string
type TermType

Returns

Term

Exceptions

InvalidOperationException

The term has been defined with a different type.

GetTerm(int)

public Term GetTerm(int id)

Parameters

id int

Returns

Term

GetTerm(string)

public Term GetTerm(string term)

Parameters

term string

Returns

Term

IsTerm(string)

Returns whether the string is a key in the term lookup.

public bool IsTerm(string value)

Parameters

value string

Returns

bool

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 LogicFileType
data object