AttributeSet
A class in Root.Township, the global namespace.
Biome attribute values (such as for spawning) with an optional parent set to fall back on. Unset values are rolled from the attribute's default range on first read.
- Listed in Global namespace: A to B
- Inherits or implements IEnumerable<KeyValuePair<BiomeAttribute, float>>,
IEnumerable - Documented in Caves
Constructors
| Member | What it is |
|---|---|
AttributeSet(AttributeSet parent) | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
1 private and internal field
| Member | What it is |
|---|---|
private Dictionary<BiomeAttribute, float> attributes | This set's own attribute values. Missing ones fall back to the parent, or are rolled from the attribute's default range and stored. |
Properties
| Member | What it is |
|---|---|
AttributeSet Parent { get; private set; } | The set to fall back on. |
Methods
| Member | What it is |
|---|---|
float Get(BiomeAttribute attribute, Random random = null) | Returns the value here, else the parent's; with no parent, rolls one in the default range and stores it. |
IEnumerator<KeyValuePair<BiomeAttribute, float>> GetEnumerator() (iterator) | Lists values set here, then the parent's values not overridden here. |
bool IsSet(BiomeAttribute attribute, bool isIncludingParent = true) | Whether the attribute has a value here (or in a parent, by default). |
void Set(BiomeAttribute attribute, float value) | Sets a value in this set. |
void SetParent(AttributeSet parent) | Changes the parent set. |
1 private and internal method
Used in
Members of other types that take, return or hold a AttributeSet:
CaveGeneratingBiome.GenerateAttributes, Distribution.GetRandomAs, Distribution<TThis, T, TItem, TFestivityGroup>.GetMultiplier, Distribution<TThis, T, TItem, TFestivityGroup>.GetRandom, Distribution<TThis, T, TItem, TFestivityGroup>.GetRandomIndex, Distribution<TThis, T, TItem, TFestivityGroup>.BaseItem.GetValue, Element.GetEfficiency, GeneratedBiome.Attributes, GeneratedBiome.GeneratedBiome, GeneratingBiome.GenerateAttributes, IBiomeValues.Attributes, IDistribution<T>.GetRandom, IDistributionItem<T>.GetValue, IDistributionValue.Evaluate, Section.ApplyMultipliers, Edge.Attributes, Node<TNode, TPath>.Attributes, AttributeImpact.GetImpact, AttributeEvaluation.GetEfficiency, AttributeUsage.GetValue, GenerationCore.Evaluate, SpawnData.Attributes.