From 5146895cf537dd69867da612abed5b4abaf805cd Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 18 Sep 2025 12:06:59 -0300 Subject: ME ELIMINE AAAAAAAAAAAAAAAAAAAAAAAAAAAA --- scripts/Map/Map.cs | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'scripts/Map/Map.cs') diff --git a/scripts/Map/Map.cs b/scripts/Map/Map.cs index 9117bc5..8521797 100644 --- a/scripts/Map/Map.cs +++ b/scripts/Map/Map.cs @@ -9,35 +9,35 @@ namespace TheLegendOfGustav.Map; /// public partial class Map : Node2D { - /// - /// Dados do mapa. - /// - public MapData MapData { get; private set; } - /// /// raio de alcance da visão do jogador. /// [Export] - private int FovRadius { get; set; } = 12; + private int fovRadius = 12; + + private FieldOfView fieldOfView; + + private Node2D tilesNode; + private Node2D entitiesNode; /// /// Gerador de mapas. /// - private DungeonGenerator Generator { get; set; } - - FieldOfView FieldOfView { get; set; } - - private Node2D TilesNode { get; set; } - private Node2D EntitiesNode { get; set; } + private DungeonGenerator generator; + /// + /// Dados do mapa. + /// + public MapData MapData { get; private set; } + public override void _Ready() { base._Ready(); // Começamos obtendo nós relevantes para o mapa. - Generator = GetNode("Generator"); - FieldOfView = GetNode("FieldOfView"); - TilesNode = GetNode("Tiles"); - EntitiesNode = GetNode("Entities"); + generator = GetNode("Generator"); + fieldOfView = GetNode("FieldOfView"); + tilesNode = GetNode("Tiles"); + entitiesNode = GetNode("Entities"); } /// @@ -46,7 +46,7 @@ public partial class Map : Node2D /// O gerador de mapas precisa do jogador. public void Generate(Player player) { - MapData = Generator.GenerateDungeon(player); + MapData = generator.GenerateDungeon(player); MapData.EntityPlaced += OnEntityPlaced; @@ -60,7 +60,7 @@ public partial class Map : Node2D /// Centro de visão, normalmente é a posição do jogador. public void UpdateFOV(Vector2I pos) { - FieldOfView.UpdateFOV(MapData, pos, FovRadius); + fieldOfView.UpdateFOV(MapData, pos, fovRadius); // Esconde ou revela entidades com base no campo de visão. foreach (Entity entity in MapData.Entities) { @@ -76,7 +76,7 @@ public partial class Map : Node2D { foreach (Tile tile in MapData.Tiles) { - TilesNode.AddChild(tile); + tilesNode.AddChild(tile); } } @@ -87,12 +87,12 @@ public partial class Map : Node2D { foreach (Entity entity in MapData.Entities) { - EntitiesNode.AddChild(entity); + entitiesNode.AddChild(entity); } } private void OnEntityPlaced(Entity entity) { - EntitiesNode.AddChild(entity); + entitiesNode.AddChild(entity); } } -- cgit v1.2.3