Skip to main content

ChunkConnections

A class in Root.Township, Alta.Chunks.

A location chunk's links to other chunks: forced adjacent chunks (set in the inspector or at runtime, for example cave layers) and culling portals. Found on LocationChunk.Connections.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private List<ChunkAdjacencyConfiguration> forcedAdjacentBacking field for ForcedAdjacent.
private static Logger loggerNLog logger; logs each two-way connection made.

Properties​

MemberWhat it is
LocationChunk Chunk { get; private set; }The location chunk these connections belong to, set by Initialize.
List<ChunkAdjacencyConfiguration> ForcedAdjacent { get; }Chunks treated as adjacent to this one regardless of position.
List<CullingPortal> Portals { get; }Culling portals leading out of this chunk.

Methods​

MemberWhat it is
static void ConnectTwoWay(LocationChunk a, LocationChunk b, float connectionCost = 1)Links two location chunks to each other with the given cost. Used by CaveLayerManager to join caves to their entrances.
void Initialize(LocationChunk chunk)Sets the owning chunk.
2 private and internal methods
MemberWhat it is
private void AddAdjacent(LocationChunk chunk, float connectionCost = 1)Adds a forced link to a chunk and removes it again when that chunk's entity is destroyed by the scene.
private void RemoveAdjacent(NetworkEntity entity, bool isUnload)Drops the forced link to a chunk whose entity was destroyed. Hooked to DestroyedByScene by AddAdjacent.

Used in​

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