LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/DunGen/DungeonGraph.cs

27 lines
823 B
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
using System.Collections.Generic;
namespace DunGen
{
public class DungeonGraph
{
public readonly List<DungeonGraphNode> Nodes = new List<DungeonGraphNode>();
public readonly List<DungeonGraphConnection> Connections = new List<DungeonGraphConnection>();
public DungeonGraph(Dungeon dungeon)
{
Dictionary<Tile, DungeonGraphNode> dictionary = new Dictionary<Tile, DungeonGraphNode>();
foreach (Tile allTile in dungeon.AllTiles)
{
DungeonGraphNode item = (dictionary[allTile] = new DungeonGraphNode(allTile));
Nodes.Add(item);
}
foreach (DoorwayConnection connection in dungeon.Connections)
{
DungeonGraphConnection item2 = new DungeonGraphConnection(dictionary[connection.A.Tile], dictionary[connection.B.Tile], connection.A, connection.B);
Connections.Add(item2);
}
}
}
}