Table of Contents

Class BranchedItem

Namespace
RandomizerCore.LogicItems
Assembly
RandomizerCore.dll
public sealed record BranchedItem : LogicItem, ILogicItem, ILogicItemTemplate, IEquatable<LogicItem>, IConditionalItem, IEquatable<BranchedItem>
Inheritance
BranchedItem
Implements
Inherited Members

Constructors

BranchedItem(string, LogicDef, LogicItem?, LogicItem?)

public BranchedItem(string Name, LogicDef Logic, LogicItem? TrueItem, LogicItem? FalseItem)

Parameters

Name string
Logic LogicDef
TrueItem LogicItem
FalseItem LogicItem

Properties

FalseItem

public LogicItem? FalseItem { get; init; }

Property Value

LogicItem

Logic

public LogicDef Logic { get; init; }

Property Value

LogicDef

TrueItem

public LogicItem? TrueItem { get; init; }

Property Value

LogicItem

Methods

AddTo(ProgressionManager)

Directly adds the item to the pm. This does not invoke the pm events, so it is best to implement this explicitly and use pm.Add instead.

public override void AddTo(ProgressionManager pm)

Parameters

pm ProgressionManager

CheckForEffect(ProgressionManager)

Returns false if AddTo(ProgressionManager) will not modify the ProgressionManager, otherwise returns true.

public bool CheckForEffect(ProgressionManager pm)

Parameters

pm ProgressionManager

Returns

bool

GetAffectedTerms()

Returns the terms potentially modified by the item.

public override IEnumerable<Term> GetAffectedTerms()

Returns

IEnumerable<Term>

TryAddTo(ProgressionManager)

Equivalent to calling CheckForEffect(ProgressionManager), then AddTo(ProgressionManager), and returning the result of the former.

public bool TryAddTo(ProgressionManager pm)

Parameters

pm ProgressionManager

Returns

bool