Skip to main content

ChunkPositions

A class in Root.Township, Alta.Chunks.

A location chunk's set of weighted surfaces for picking random spawn points. Held by LocationChunk.Positions; ChunkPositionSurface components add themselves to it.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private bool hasSurfacesBacking field for HasSurfaces.

Properties​

MemberWhat it is
bool HasSurfaces { get; set; }Whether the chunk has any position surfaces set up.
HashSet<ChunkPositionSurface> PositionDefinitions { get; }The surfaces registered for this chunk. Each has a weight used by GetPosition.

Methods​

MemberWhat it is
PointNormal? GetPosition(int iterations, float maxAngleFromUpDot)Picks a surface at random by weight and tries it up to iterations times for a point whose normal is steep enough. Returns null if none fits.

Used in​

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