Rule
A class in Root.Township, Alta.PAGaC.
A PAGaC placement rule: a grid of tag lists per configuration that must match before a part goes in, plus whether it can overlap itself in other rotations. A ScriptableObject that flattens its 4D tag grid for Unity serialization.
- Listed in World generation
- Inherits or implements
RuleBase,ISerializationCallbackReceiver - Nested types
RotationOverlap
Constructors
| Member | What it is |
|---|---|
Rule() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
1 private and internal field
| Member | What it is |
|---|---|
private Rule.RotationOverlap rotationOverlap | Backing field for Overlap. |
Properties
| Member | What it is |
|---|---|
Rule.RotationOverlap Overlap { get; } | Whether the same rule may be placed again in the same cells at another rotation (perpendicular, mirrored, either, all or none). |
Methods
| Member | What it is |
|---|---|
static void DeSerialize(int configurations, int sizeX, int sizeY, int sizeZ, List<Tag>[,,,] tags, Tag[] serializedTags, int[] serializedTagCounts) | Fills the 4D tag grid from the flat tag array and per-cell counts. |
void ForceBeforeSerialize() | Runs the before-serialize step by hand, flattening the tag grid into the serialized arrays. |
static void RecreateTags(ref List<Tag>[,,,] tags, int configurations, int sizeX, int sizeY, int sizeZ) | Makes a fresh 4D grid of empty tag lists at the given sizes. |
static void Resize(bool isClearing, ref List<Tag>[,,,] tags, int configurations, int sizeX, int sizeY, int sizeZ) | Recreates the tag grid if its sizes don't match, or clears every list when isClearing is set. |
static void Serialize(int configurations, int sizeX, int sizeY, int sizeZ, List<Tag>[,,,] tags, ref Tag[] serializedTags, ref int[] serializedTagCounts) | Flattens the 4D tag grid into one tag array plus a count per cell. |
3 private and internal methods
Used in
Members of other types that take, return or hold a Rule: