Skip to main content

OptionSet

A class in Root.Township, Alta.PAGaC.

A weighted set of parts for procedural generation. Evaluating it rolls each part and nested set by its own chance.

Constructors​

MemberWhat it is
OptionSet()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

5 private and internal fields
MemberWhat it is
private bool isWeightingIndividualBacking field for IsWeightingIndividual.
private LockMode lockModeBacking field for LockMode.
private OptionSetChance[] optionSetsNested option sets, each with a chance to be evaluated.
private PartChance[] partsParts, each with a chance to be added.
private RuleOptionSetChance[] ruleOptionSetsRule option sets, each with a chance to be evaluated.

Properties​

MemberWhat it is
bool IsWeightingIndividual { get; }Flag from the asset; not read by Evaluate.
LockMode LockMode { get; }The set's lock mode (Building by default); not read by Evaluate.

Methods​

MemberWhat it is
void Evaluate(List<Part> results)Rolls each nested set, part and rule set against its weight and adds the picked parts to the list.

Used in​

Members of other types that take, return or hold a OptionSet: