Struct MapCorridor<TCoord>
Represents a single corridor segment that was carved between two rooms during procedural map generation. Corridors are produced by the BSP and Room-and-Corridor algorithms and are collected in Corridors.
Each corridor references exactly two rooms by their ID values. The IDs correspond to indices into Rooms, making it straightforward to look up room metadata from a corridor reference.
The Cells list contains every grid coordinate carved as part of the corridor path, in traversal order from the first room toward the second. For L-shaped corridors this is a single continuous path with one bend; for winding corridors the path may include multiple jog segments. All cells in Cells have been written to the grid with the CorridorValue cell value at the time the result is returned.
Inherited Members
Namespace: Scylla.Core.Util.ProceduralMapGen
Assembly: ScyllaCore.dll
Syntax
public readonly struct MapCorridor<TCoord> where TCoord : struct, IEquatable<TCoord>
Type Parameters
| Name | Description |
|---|---|
| TCoord | The grid coordinate type used by the map. Must be a value type implementing
IEquatable<T>. Common choices are |
Constructors
MapCorridor(int, int, List<TCoord>)
Initializes a new MapCorridor<TCoord> with the specified room IDs and cell path. This constructor is called internally by ProceduralMapGenerator algorithms and is generally not needed in consumer code.
Declaration
public MapCorridor(int roomIDA, int roomIDB, List<TCoord> cells)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roomIDA | The ID of the first connected room. |
| int | roomIDB | The ID of the second connected room. |
| List<TCoord> | cells | The ordered list of all grid coordinates that form the corridor path. Must not be
|
Fields
Cells
The ordered list of all grid coordinates that form this corridor path, from the
first room's center toward the second. The list will never be null for corridors
produced by ProceduralMapGenerator, but may be empty if the two rooms share a
border and no additional carving was required.
All coordinates in this list have been written to the map grid with the CorridorValue value. For LShaped corridors the path consists of two straight axis-aligned runs; for Winding corridors the path may contain additional intermediate jog segments governed by WindingCorridorSettings.
Declaration
public readonly List<TCoord> Cells
Field Value
| Type | Description |
|---|---|
| List<TCoord> |
RoomIDA
The ID of the first room connected by this corridor. Together with RoomIDB, this pair uniquely identifies the room-to-room connection within a single MapGenResult<TCoord>. Use this value as an index into Rooms to retrieve the full MapRoom<TCoord> metadata for the first endpoint.
Declaration
public readonly int RoomIDA
Field Value
| Type | Description |
|---|---|
| int |
RoomIDB
The ID of the second room connected by this corridor. Together with RoomIDA, this pair uniquely identifies the room-to-room connection within a single MapGenResult<TCoord>. Use this value as an index into Rooms to retrieve the full MapRoom<TCoord> metadata for the second endpoint.
Declaration
public readonly int RoomIDB
Field Value
| Type | Description |
|---|---|
| int |
Methods
ToString()
Returns a human-readable string representation of this corridor for debugging purposes, including both room IDs and the number of cells in the carved path.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string of the form |