Skip to main content

CellularAutomata

A class in Root.Township, Alta.Caves.PluginParts.

Cave generator part that runs one cellular automata step on a Y slice: each cell becomes one value if its neighbours sum to the threshold, another if not.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private int captureRadiusBacking field for CaptureRadius.
private float thresholdBacking field for Threshold.
private float valueIfFalseBacking field for ValueIfFalse.
private float valueIfTrueBacking field for ValueIfTrue.
private int yIndexBacking field for YIndex.

Properties​

MemberWhat it is
int CaptureRadius { get; }How many cells out from each cell are summed (default 1). Cells this close to the edge are left as they were.
float Threshold { get; }Sum of the neighbourhood needed to count as true (default 0.5).
float ValueIfFalse { get; }Value written when the sum stays below Threshold.
float ValueIfTrue { get; }Value written when the sum reaches Threshold.
int YIndex { get; }Which Y slice of the layer is processed.

Methods​

MemberWhat it is
override IPartInstance GetInstance(PluginInstance plugin)Creates the CellularAutomataInstance that does the work.

Used in​

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