Skip to main content

Generator

A class in Root.Township, Alta.PAGaC.

A 3D grid of tagged nodes for procedural construction, all set to the air tag at first.

Constructors​

MemberWhat it is
Generator(int sizeX, int sizeY, int sizeZ, Tag air)Creates a Generator from sizeX, sizeY, sizeZ and air.

Fields​

1 private and internal field
MemberWhat it is
private Node[,,] nodesThe 3D grid of nodes, each starting tagged as air.

Properties​

MemberWhat it is
Node this[int x, int y, int z] { get; }The node at x, y, z.
int SizeX { get; private set; }Grid size in x.
int SizeY { get; private set; }Grid size in y.
int SizeZ { get; private set; }Grid size in z.

Methods​

MemberWhat it is
Node CastTo(int x, int y, int z, int xInterval, int yInterval, int zInterval, IEnumerable<Tag> tags, int maxDistance = 2147483647)Steps from a cell by an interval until a node with one of the tags. Only positive intervals work: 0 divides by zero and negatives stop at once.
Node CastToNot(int x, int y, int z, int xInterval, int yInterval, int zInterval, IEnumerable<Tag> tags, int maxDistance = 2147483647)Like CastTo, but starts in a tagged cell and stops at the first node without those tags. Same interval limits.
Tag[,,] Export()The tag of every node as a 3D array.

Used in​

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