summaryrefslogtreecommitdiff
path: root/scripts/Map/Map.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-18 12:06:59 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-18 12:06:59 -0300
commit5146895cf537dd69867da612abed5b4abaf805cd (patch)
tree70212352a07922b58db99ba2564f76ca072af200 /scripts/Map/Map.cs
parenteacdd15612c70ff86f3446982c46a09272249936 (diff)
ME ELIMINE AAAAAAAAAAAAAAAAAAAAAAAAAAAA
Diffstat (limited to 'scripts/Map/Map.cs')
-rw-r--r--scripts/Map/Map.cs42
1 files changed, 21 insertions, 21 deletions
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
@@ -10,34 +10,34 @@ namespace TheLegendOfGustav.Map;
public partial class Map : Node2D
{
/// <summary>
- /// Dados do mapa.
- /// </summary>
- public MapData MapData { get; private set; }
-
- /// <summary>
/// raio de alcance da visão do jogador.
/// </summary>
[Export]
- private int FovRadius { get; set; } = 12;
+ private int fovRadius = 12;
+
+ private FieldOfView fieldOfView;
+
+ private Node2D tilesNode;
+ private Node2D entitiesNode;
/// <summary>
/// Gerador de mapas.
/// </summary>
- private DungeonGenerator Generator { get; set; }
-
- FieldOfView FieldOfView { get; set; }
-
- private Node2D TilesNode { get; set; }
- private Node2D EntitiesNode { get; set; }
+ private DungeonGenerator generator;
+ /// <summary>
+ /// Dados do mapa.
+ /// </summary>
+ public MapData MapData { get; private set; }
+
public override void _Ready()
{
base._Ready();
// Começamos obtendo nós relevantes para o mapa.
- Generator = GetNode<DungeonGenerator>("Generator");
- FieldOfView = GetNode<FieldOfView>("FieldOfView");
- TilesNode = GetNode<Node2D>("Tiles");
- EntitiesNode = GetNode<Node2D>("Entities");
+ generator = GetNode<DungeonGenerator>("Generator");
+ fieldOfView = GetNode<FieldOfView>("FieldOfView");
+ tilesNode = GetNode<Node2D>("Tiles");
+ entitiesNode = GetNode<Node2D>("Entities");
}
/// <summary>
@@ -46,7 +46,7 @@ public partial class Map : Node2D
/// <param name="player">O gerador de mapas precisa do jogador.</param>
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
/// <param name="pos">Centro de visão, normalmente é a posição do jogador.</param>
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);
}
}