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
| Member | What it is |
|---|
OptionSet() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private bool isWeightingIndividual | Backing field for IsWeightingIndividual. |
private LockMode lockMode | Backing field for LockMode. |
private OptionSetChance[] optionSets | Nested option sets, each with a chance to be evaluated. |
private PartChance[] parts | Parts, each with a chance to be added. |
private RuleOptionSetChance[] ruleOptionSets | Rule option sets, each with a chance to be evaluated. |
Properties
| Member | What 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
| Member | What 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: