Table of Contents

Class LogicDef

Namespace
RandomizerCore.Logic
Assembly
RandomizerCore.dll

Class representing a logic clause, which can be evaluated with a ProgressionManager.

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

Constructors

LogicDef(string, string)

public LogicDef(string name, string infixSource)

Parameters

name string
infixSource string

Properties

InfixSource

The string logic from which the LogicDef was constructed.

public string InfixSource { get; }

Property Value

string

Name

An identifier for the LogicDef. May not be unique.

public string Name { get; }

Property Value

string

Methods

CanGet(ProgressionManager)

Evaluates the logic, for the given progression data input.

public abstract bool CanGet(ProgressionManager pm)

Parameters

pm ProgressionManager

Returns

bool

GetTerms()

The sequence of terms on which the LogicDef depends. Terms not included in the sequence must not affect the value of CanGet.

public abstract IEnumerable<Term> GetTerms()

Returns

IEnumerable<Term>

ToInfix()

The string representation of the LogicDef. Must be logically equivalent to InfixSource, but generally does not contain macros and may be expanded or simplified in other ways.

public virtual string ToInfix()

Returns

string

ToLogicClause()

Creates a LogicClause equivalent to the LogicDef using ToTokenSequence().

public LogicClause ToLogicClause()

Returns

LogicClause

ToLogicClauseBuilder()

Creates a LogicClauseBuilder equivalent to the LogicDef using ToTokenSequence().

public LogicClauseBuilder ToLogicClauseBuilder()

Returns

LogicClauseBuilder

ToString()

public override string ToString()

Returns

string

ToTokenSequence()

Converts the LogicDef to its equivalent sequence of LogicTokens in RPN format.

public abstract IEnumerable<LogicToken> ToTokenSequence()

Returns

IEnumerable<LogicToken>