Skip to main content

ICaveLayer

An interface in Root.Township, Alta.Chunks.

One layer of a procedural cave, managed by a CaveLayerManager and linked to the layers around it by portals.

Properties​

MemberWhat it is
LocationChunk Chunk { get; }The location chunk of this layer.
float Depth { get; }How deep the layer is.
NetworkEntity Entity { get; }The layer's network entity.
Vector2 Entrance { get; }Where the layer's entrance is.
int LayerIdentifier { get; }The layer number.
CaveLayerManager Manager { get; }The cave layer manager.
string name { get; set; }The layer object's name.
Transform PortalTransform { get; }Transform of the portal into this layer.

Events​

MemberWhat it is
event Action<int, float, Vector2, Vector2> ExitReadyRaised when the layer's exit is placed, with this layer's number, the depth below it, and the exit position and direction.

Methods​

MemberWhat it is
string GetIdentifier(int layer)Builds the identifier string for a layer number.
void InitializeCaveLayer(CaveLayerManager manager, int layer)Sets the layer's manager and layer number.
void RegisterPortal(LocationChunk chunk, ICaveLayer other)Links this layer's portal in a chunk to another layer.
void SetEntrance(float depth, Vector2 entrance, Vector2 direction)Sets the depth, entrance position and direction.

Used in​

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