diff --git a/Assets/Scripts/Gameplay/GameplayManager.cs b/Assets/Scripts/Gameplay/GameplayManager.cs index d525db9..692a055 100644 --- a/Assets/Scripts/Gameplay/GameplayManager.cs +++ b/Assets/Scripts/Gameplay/GameplayManager.cs @@ -290,19 +290,20 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader } // TODO :: Double check - // foreach (var key in botPawnsDictForCurrentPlayer.Keys) - // botPawnsDictForCurrentPlayer[key] = BotMove.NoMoves; + foreach (var key in botPawnsDictForCurrentPlayer.Keys) + { + Debug.Log($"b :: botPawnsDictForCurrentPlayer[key]: {botPawnsDictForCurrentPlayer[key]}"); + // botPawnsDictForCurrentPlayer[key] = BotMove.NoMoves; + Debug.Log($"a :: botPawnsDictForCurrentPlayer[key]: {botPawnsDictForCurrentPlayer[key]}"); + } + + Debug.Log($"Before Iterating"); foreach (var playerPawn in availPlayers) { + Debug.Log($"Iterating"); var possibleLandingIndex = playerPawn.CurrentTileIndex + diceRolledValue; - if (playerPawn.GetPlayerState() == PlayerState.HasFinished) - { - botPawnsDictForCurrentPlayer.Remove(playerPawn.PlayerId); // TODO :: Double check logic - continue; - } - int lastIndex = tilesManager.GetGeneralTilesLength() - 1; int index = possibleLandingIndex > lastIndex ? possibleLandingIndex - lastIndex - 1 : possibleLandingIndex; Tile possibleTileData = tilesManager.RetrieveTileBasedOnIndex(index); @@ -313,6 +314,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath || possibleLandingIndex > playerGameDatasDict[currentPlayerTypeTurn].endIndex) { + Debug.Log($"AI playerPawn :: {playerPawn.name} :: {playerPawn.PlayerId} :: inFinishingPath :: canSelectPlayer: {playerPawn.CanSelectPlayer}"); if (playerPawn.CanSelectPlayer) { botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.FinishingPathMove; @@ -324,12 +326,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.NoMoves; } } - else if (possibleTileData.IsSafeZone || playerPawn.GetPlayerState() == PlayerState.InHome) + else if (possibleTileData.IsSafeZone) { + Debug.Log($"AI playerPawn :: {playerPawn.name} :: {playerPawn.PlayerId} :: safeMove"); botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.SafeMove; } else if (possibleTileData.PlayerPawn != null) { + Debug.Log($"AI playerPawn :: {playerPawn.name} :: {playerPawn.PlayerId} :: attackMove"); botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.AttackMove; } else @@ -456,7 +460,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader for (int i = 0; i < availPlayers.Count; i++) { Debug.Log($"## playerPawn.GetPlayerState(): {availPlayers[i].GetPlayerState()}"); - if (availPlayers[i].GetPlayerState() == PlayerState.HasFinished || availPlayers[i].GetPlayerState() == PlayerState.InHome) continue; if (availPlayers[i].GetPlayerState() == PlayerState.InFinishingPath) {