Class PathDef

Namespace
TDMaker.Core.Defs
Assembly
TDMaker.Core.dll

A path consisting of lanes with matching node counts.

public sealed class PathDef
Inheritance
PathDef
Inherited Members

Constructors

PathDef(params Vec2[][])

Copies and validates lane geometry; duplicate adjacent nodes are permitted.

public PathDef(params Vec2[][] lanes)

Parameters

lanes Vec2[][]

PathDef(Vec2[][], int, int)

Creates a path with explicit entry and exit markers.

public PathDef(Vec2[][] lanes, int entryNode, int exitNode)

Parameters

lanes Vec2[][]
entryNode int
exitNode int

Properties

EntryNode

Node at which enemies enter the lane.

public int EntryNode { get; }

Property Value

int

ExitNode

Node at which enemies leave the level.

public int ExitNode { get; }

Property Value

int

FollowingPathIndex

Next path index, or minus one for a final exit.

public int FollowingPathIndex { get; }

Property Value

int

LaneCount

Number of parallel lanes.

public int LaneCount { get; }

Property Value

int

NodeCount

Number of nodes per lane.

public int NodeCount { get; }

Property Value

int

Methods

GetNode(int, int)

Reads a node without exposing mutable arrays.

public Vec2 GetNode(int lane, int node)

Parameters

lane int
node int

Returns

Vec2

GetRemainingDistance(int, int)

Reads distance from a node to the exit along its lane.

public float GetRemainingDistance(int lane, int node)

Parameters

lane int
node int

Returns

float

WithFollowingPath(int)

Copies immutable geometry with a forward path connection; the level validates references and cycles.

public PathDef WithFollowingPath(int followingPathIndex)

Parameters

followingPathIndex int

Returns

PathDef