summaryrefslogtreecommitdiff
path: root/scripts/Game.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/Game.cs
parenteacdd15612c70ff86f3446982c46a09272249936 (diff)
ME ELIMINE AAAAAAAAAAAAAAAAAAAAAAAAAAAA
Diffstat (limited to 'scripts/Game.cs')
-rw-r--r--scripts/Game.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/scripts/Game.cs b/scripts/Game.cs
index 3bb1b83..f03aa20 100644
--- a/scripts/Game.cs
+++ b/scripts/Game.cs
@@ -21,23 +21,23 @@ public partial class Game : Node
/// <summary>
/// O jogo possui o mapa.
/// </summary>
- private Map.Map Map { get; set; }
+ private Map.Map map;
/// <summary>
/// Objeto para obter input do usuário.
/// </summary>
- private InputHandler InputHandler { get; set; }
+ private InputHandler inputHandler;
/// <summary>
/// Gerenciador de turnos
/// </summary>
- private TurnManager TurnManager { get; set; }
+ private TurnManager turnManager;
private Hud hud;
+ private SignalBus.EscapeRequestedEventHandler escapeLambda;
+
[Signal]
public delegate void MainMenuRequestedEventHandler();
- private SignalBus.EscapeRequestedEventHandler escapeLambda;
-
public override void _Ready()
{
base._Ready();
@@ -45,9 +45,9 @@ public partial class Game : Node
escapeLambda = () => EmitSignal(SignalName.MainMenuRequested);
SignalBus.Instance.EscapeRequested += escapeLambda;
- Map = GetNode<Map.Map>("Map");
+ map = GetNode<Map.Map>("Map");
- InputHandler = GetNode<InputHandler>("InputHandler");
+ inputHandler = GetNode<InputHandler>("InputHandler");
hud = GetNode<Hud>("HUD");
// O jogador é criado pelo jogo.
@@ -56,15 +56,15 @@ public partial class Game : Node
RemoveChild(camera);
player.HealthChanged += (int hp, int maxHp) => hud.OnHealthChanged(hp, maxHp);
player.ManaChanged += hud.OnManaChanged;
- player.Died += () => InputHandler.SetInputHandler(InputHandlers.GameOver);
+ player.Died += () => inputHandler.SetInputHandler(InputHandlers.GameOver);
player.AddChild(camera);
- Map.Generate(player);
+ map.Generate(player);
- Map.UpdateFOV(player.GridPosition);
+ map.UpdateFOV(player.GridPosition);
- TurnManager = new(Map);
+ turnManager = new(map);
MessageLogData.Instance.AddMessage("Boa sorte!");
}
@@ -90,18 +90,18 @@ public partial class Game : Node
{
base._PhysicsProcess(delta);
- Player player = Map.MapData.Player;
+ Player player = map.MapData.Player;
// Pegamos uma ação do usuário
- Action action = InputHandler.GetAction(player);
+ Action action = inputHandler.GetAction(player);
if (action != null)
{
- TurnManager.InsertPlayerAction(action);
+ turnManager.InsertPlayerAction(action);
}
// Computamos um turno.
- TurnManager.Tick();
+ turnManager.Tick();
}
}