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/Time/TurnManager.cs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'scripts/Time/TurnManager.cs') diff --git a/scripts/Time/TurnManager.cs b/scripts/Time/TurnManager.cs index e8f2db9..3d55fbb 100644 --- a/scripts/Time/TurnManager.cs +++ b/scripts/Time/TurnManager.cs @@ -12,16 +12,20 @@ namespace TheLegendOfGustav.Time; /// public partial class TurnManager(Map.Map map) : RefCounted { - public int TurnCount { get; private set; } = 0; - private Map.Map Map { get; set; } = map; - private MapData Map_Data { get => Map.MapData; } - private Player Player { get => Map_Data.Player; } - + private Map.Map map = map; /// /// As ações do jogador ficam em uma fila e são executadas quando /// possível dentro das regras do senhor do tempo. /// - private Godot.Collections.Array PlayerActionQueue { get; set; } = []; + private Godot.Collections.Array playerActionQueue = []; + + /// + /// A quantidade de turnos que se passaram. + /// + public int TurnCount { get; private set; } = 0; + + private MapData Map_Data { get => map.MapData; } + private Player Player { get => Map_Data.Player; } /// /// Insere uma ação na fila de ações do jogador. @@ -29,7 +33,7 @@ public partial class TurnManager(Map.Map map) : RefCounted /// public void InsertPlayerAction(Action playerAction) { - PlayerActionQueue.Add(playerAction); + playerActionQueue.Add(playerAction); } /// @@ -44,7 +48,7 @@ public partial class TurnManager(Map.Map map) : RefCounted { // Se o jogador puder agir mas a fila de ações estiver vazia, // não computamos o turno. - if (PlayerActionQueue.Count == 0 && Player.Energy > 0) + if (playerActionQueue.Count == 0 && Player.Energy > 0) { return; } @@ -59,10 +63,10 @@ public partial class TurnManager(Map.Map map) : RefCounted bool actionResult = true; ; // Primeiro executamos a ação do jogador, se ele puder. - if (PlayerActionQueue.Count > 0 && Player.Energy > 0) + if (playerActionQueue.Count > 0 && Player.Energy > 0) { - Action action = PlayerActionQueue[0]; - PlayerActionQueue.RemoveAt(0); + Action action = playerActionQueue[0]; + playerActionQueue.RemoveAt(0); actionResult = action.Perform(); @@ -80,12 +84,12 @@ public partial class TurnManager(Map.Map map) : RefCounted { // Depois computamos os turnos dos outros atores. HandleEnemyTurns(); - Map.UpdateFOV(Player.GridPosition); + map.UpdateFOV(Player.GridPosition); } // Por fim, se o jogador mudou de lugar, atualizamos seu campo de visão. if (Player.GridPosition != previousPlayerPos) { - Map.UpdateFOV(Player.GridPosition); + map.UpdateFOV(Player.GridPosition); } } -- cgit v1.2.3