Table of Contents

Class VariableResolver

Namespace
RandomizerCore.Logic
Assembly
RandomizerCore.dll

Class which parses terms in logic as LogicVariables.

public class VariableResolver
Inheritance
VariableResolver
Inherited Members

Properties

Inner

A nested VariableResolver, which runs after the parent VariableResolver in TryMatch.

public VariableResolver? Inner { get; init; }

Property Value

VariableResolver

Methods

CanMatch(LogicManager, string)

Returns true if the term can be matched to a LogicVariable.

public bool CanMatch(LogicManager lm, string term)

Parameters

lm LogicManager
term string

Returns

bool

GetStateModel()

Returns a StateManagerBuilder with the elements needed to support the VR's variables.

public virtual StateManagerBuilder GetStateModel()

Returns

StateManagerBuilder

TryMatch(LogicManager, string, out LogicInt)

[Obsolete("Use LogicVariable overload of TryMatch instead.")]
public virtual bool TryMatch(LogicManager lm, string term, out LogicInt variable)

Parameters

lm LogicManager
term string
variable LogicInt

Returns

bool

TryMatch(LogicManager, string, out LogicVariable)

Returns true if the term can be matched to a LogicVariable, and outputs the variable.

public virtual bool TryMatch(LogicManager lm, string term, out LogicVariable variable)

Parameters

lm LogicManager
term string
variable LogicVariable

Returns

bool

TryMatchPrefix(string, string, out string[])

Matches a variable identified via a prefix. The input must either equal the prefix exactly, or consist of the prefix, followed by square brackets enclosing a comma-separated list. Subexpressions within square brackets will not be split.
Outputs the comma-separated parameters list.

public static bool TryMatchPrefix(string term, string prefix, out string[] parameters)

Parameters

term string
prefix string
parameters string[]

Returns

bool