summaryrefslogtreecommitdiff
path: root/scripts/map/Map.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/map/Map.cs')
-rw-r--r--scripts/map/Map.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/map/Map.cs b/scripts/map/Map.cs
new file mode 100644
index 0000000..683ae45
--- /dev/null
+++ b/scripts/map/Map.cs
@@ -0,0 +1,28 @@
+using Godot;
+using System;
+
+public partial class Map : Node2D
+{
+ public MapData Map_Data { get; private set; }
+
+ DungeonGenerator generator;
+
+ private void PlaceTiles() {
+ foreach (Tile tile in Map_Data.Tiles) {
+ AddChild(tile);
+ }
+ }
+
+ public void Generate(Player player)
+ {
+ generator = GetNode<DungeonGenerator>("Generator");
+
+ Map_Data = generator.GenerateDungeon(player);
+
+ Map_Data.InsertActor(player);
+
+ player.Map_Data = Map_Data;
+
+ PlaceTiles();
+ }
+}