Class RailPath
Ordered sequence of nodes defining a rail path. A rail path must have at least two nodes to form a valid path.
Inherited Members
Namespace: Serenity.GameRail.Domain.Entities
Assembly: Serenity.GameRail.Domain.dll
Syntax
public class RailPath
Constructors
RailPath(RailId, IEnumerable<RailNodePosition>)
Creates a new RailPath with the specified identity and nodes.
Declaration
public RailPath(RailId id, IEnumerable<RailNodePosition> nodes)
Parameters
| Type | Name | Description |
|---|---|---|
| RailId | id | The rail identity. |
| IEnumerable<RailNodePosition> | nodes | The ordered sequence of nodes. |
Properties
Id
Gets the identity of this rail path.
Declaration
public RailId Id { get; }
Property Value
| Type | Description |
|---|---|
| RailId |
IsValid
Gets whether this path is valid (has at least two nodes).
Declaration
public bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| bool |
NodeCount
Gets the number of nodes in the path.
Declaration
public int NodeCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Nodes
Gets a read-only view of the path nodes.
Declaration
public IReadOnlyList<RailNodePosition> Nodes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<RailNodePosition> |
Methods
GetNode(int)
Gets the node at the specified index.
Declaration
public RailNodePosition GetNode(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the node. |
Returns
| Type | Description |
|---|---|
| RailNodePosition | The node position at the specified index. |