summaryrefslogtreecommitdiff
path: root/scripts/Map/MapData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Map/MapData.cs')
-rw-r--r--scripts/Map/MapData.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/Map/MapData.cs b/scripts/Map/MapData.cs
index 5f96743..907e8d0 100644
--- a/scripts/Map/MapData.cs
+++ b/scripts/Map/MapData.cs
@@ -84,6 +84,10 @@ public partial class MapData : RefCounted, ISaveable
return list;
}
}
+
+ public int CurrentFloor { get; set; } = 0;
+
+ public Vector2I DownstairsLocation { get; set; }
/// <summary>
/// Objeto do Godot que utiliza do algoritmo A* para calcular
/// caminhos e rotas.
@@ -349,6 +353,9 @@ public partial class MapData : RefCounted, ISaveable
{"player", Player.GetSaveData()},
{"width", Width},
{"height", Height},
+ {"current_floor", CurrentFloor},
+ {"down_stairs_location_x", DownstairsLocation.X},
+ {"down_stairs_location_y", DownstairsLocation.Y}
};
}
@@ -357,6 +364,9 @@ public partial class MapData : RefCounted, ISaveable
Width = (int)saveData["width"];
Height = (int)saveData["height"];
+ CurrentFloor = (int)saveData["current_floor"];
+ DownstairsLocation = new((int)saveData["down_stairs_location_x"], (int)saveData["down_stairs_location_y"]);
+
SetupTiles();
Array<Dictionary<string, Variant>> serializedTiles = (Array<Dictionary<string, Variant>>)saveData["tiles"];