Skip to main content

NodeCollection

A class in Root.Township, Alta.PAGaC.

A set of grid nodes from the PAGaC procedural generator, with a running bounding box. The bounds code has slips (max Y and Z are only updated when X grows, and recalculated maxes use the minimum), so treat the bounds as rough.

Constructors​

MemberWhat it is
NodeCollection()Creates a NodeCollection with default values.

Fields​

1 private and internal field
MemberWhat it is
private HashSet<Node> nodesThe set of nodes in the collection.

Properties​

MemberWhat it is
int MaxX { get; private set; }Highest X in the collection.
int MaxY { get; private set; }Highest Y in the collection, but see the summary.
int MaxZ { get; private set; }Highest Z in the collection, but see the summary.
int MinX { get; private set; }Lowest X in the collection.
int MinY { get; private set; }Lowest Y in the collection.
int MinZ { get; private set; }Lowest Z in the collection.
IEnumerable<Node> Nodes { get; }The nodes in the collection.

Methods​

MemberWhat it is
bool Add(IEnumerable<Node> adding)Adds one or more nodes and widens the bounds. Returns true if any node was new.
bool Add(Node node)Adds one or more nodes and widens the bounds. Returns true if any node was new.
bool AddExtents(Generator generator, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)Adds every generator node in a box and widens the bounds. Returns true if any node was new.
IEnumerable<Node> GetOverlap(NodeCollection other) (iterator)Nodes that are in both collections, checking the bounds first.
bool Remove(Node node)Removes one or more nodes and recalculates any bound they were on.
bool Remove(IEnumerable<Node> removing)Removes one or more nodes and recalculates any bound they were on.
bool RemoveExtents(Generator generator, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)Removes the generator nodes in a box (upper edges exclusive) and recalculates the bounds.
1 private and internal method
MemberWhat it is
private void RemovingFinished(int recalculating)Recalculates the bounds that removed nodes sat on; the flags say which min or max sides to redo.

Used in​

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