Class LevelDescriptionBase
Namespace: Edgar.Unity
Assembly: cs.temp.dll.dll
Syntax
public abstract class LevelDescriptionBase
Fields
Connections
Declaration
protected List<ConnectionBase> Connections
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ConnectionBase> |
CorridorRoomDescriptions
Declaration
protected List<RoomDescriptionGrid2D> CorridorRoomDescriptions
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<RoomDescriptionGrid2D> |
CorridorToConnectionMapping
Declaration
protected TwoWayDictionary<RoomBase, ConnectionBase> CorridorToConnectionMapping
Field Value
| Type | Description |
|---|---|
| TwoWayDictionary<RoomBase, ConnectionBase> |
LevelDescription
Declaration
protected LevelDescriptionGrid2D<RoomBase> LevelDescription
Field Value
| Type | Description |
|---|---|
| Edgar.Unity.LevelDescriptionGrid2D<RoomBase> |
PrefabToRoomTemplateMapping
Declaration
protected TwoWayDictionary<GameObject, RoomTemplateGrid2D> PrefabToRoomTemplateMapping
Field Value
| Type | Description |
|---|---|
| TwoWayDictionary<GameObject, RoomTemplateGrid2D> |
Methods
AddConnection(ConnectionBase)
Adds a given connection without a corridor between the two rooms.
Declaration
public void AddConnection(ConnectionBase connection)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionBase | connection | Connection that is added to the level description |
AddCorridorConnection(ConnectionBase, RoomBase, List<GameObject>)
Adds a given connection together with a corridor room between the two rooms.
Declaration
public void AddCorridorConnection(ConnectionBase connection, RoomBase corridorRoom, List<GameObject> corridorRoomTemplates)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionBase | connection | Connection that is added to the level description |
| RoomBase | corridorRoom | Room that represents the corridor room between the two rooms from the connection |
| System.Collections.Generic.List<GameObject> | corridorRoomTemplates | Room templates that are available for the corridor |
AddRoom(RoomBase, List<GameObject>)
Adds a given room together with a list of available room templates.
Declaration
public void AddRoom(RoomBase room, List<GameObject> roomTemplates)
Parameters
| Type | Name | Description |
|---|---|---|
| RoomBase | room | Room that is added to the level description. |
| System.Collections.Generic.List<GameObject> | roomTemplates | Room templates that are available for the room. |
GetGraph()
Gets the graph of rooms.
Declaration
public IGraph<RoomBase> GetGraph()
Returns
| Type | Description |
|---|---|
| IGraph<RoomBase> |
Remarks
The graph is not updated when new rooms are added to the level description. Adding rooms to the graph does not update the level description. This behaviour may change in the future.
GetGraphWithCorridors()
Gets the graph of rooms where also corridors are considered to be rooms.
Declaration
public IGraph<RoomBase> GetGraphWithCorridors()
Returns
| Type | Description |
|---|---|
| IGraph<RoomBase> |
Remarks
The graph is not updated when new rooms are added to the level description. Adding rooms to the graph does not update the level description. This behaviour may change in the future.
TryGetRoomTemplate(GameObject, out RoomTemplateGrid2D, out ActionResult)
Declaration
protected abstract bool TryGetRoomTemplate(GameObject roomTemplatePrefab, out RoomTemplateGrid2D roomTemplate, out ActionResult result)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | roomTemplatePrefab | |
| RoomTemplateGrid2D | roomTemplate | |
| ActionResult | result |
Returns
| Type | Description |
|---|---|
| System.Boolean |