Skip to main content

RuleBase

An abstract class in Root.Township, Alta.PAGaC.

Base asset for a PAGaC (procedural generation) rule: a 3D grid of tag lists, with one grid per configuration (probably rotations or variants).

Constructors​

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

Fields​

MemberWhat it is
protected int configurationsNumber of tag configurations the rule has. Each is a full grid of tag lists.
protected int[] serializedTagCountsHow many tags each cell has in serializedTags, probably.
protected Tag[] serializedTagsFlat list of tags as stored in the asset, probably unpacked into tags on load.
protected int sizeXWidth of the rule's grid in cells.
protected int sizeYHeight of the rule's grid in cells.
protected int sizeZDepth of the rule's grid in cells.
protected List<Tag>[,,,] tagsThe 4D grid of tag lists, indexed by configuration, x, y, z. Rebuilt from the serialized arrays on load.

Properties​

MemberWhat it is
int Configurations { get; }Number of configurations the rule has, each with its own tag grid.
List<Tag> this[int configuration, int x, int y, int z] { get; }Indexer: the tag list at a configuration and cell.
int SizeX { get; }Width of the rule's grid in cells.
int SizeY { get; }Height of the rule's grid in cells.
int SizeZ { get; }Depth of the rule's grid in cells.
List<Tag>[,,,] Tags { get; }The tag lists, indexed by configuration, x, y and z.

Used in​

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