using UnityEngine; using System.Collections.Generic; [System.Serializable] public class PlayerPlacementData { public PlayerPawn pawn; } [System.Serializable] public class PlayerTileData { public int playerCount; public Transform commonPlacementTransform; public Dictionary playerPawns; } public class Tile : MonoBehaviour { [SerializeField] protected bool isSafeZone = false; [SerializeField] protected Transform centeredPoint; public bool IsSafeZone => isSafeZone; public Vector3 CenterPlacementPosition => centeredPoint.position; protected int lastOccupiedIndex = 0; private List PlayerPawns = new List(); // Change implementation public bool HasPawnsAvailable => PlayerPawns.Count > 0; public PlayerType CurrentHoldingPlayerType => PlayerPawns[0].PlayerType; public int TotalPawnsInTile => PlayerPawns.Count; public PlayerPawn GetPlayerPawn() { var pawn = PlayerPawns[0]; PlayerPawns.RemoveAt(0); return pawn; } public virtual void InitPlayerPawn(PlayerPawn playerPawn, PlayerType playerType) { PlayerPawns.Add(playerPawn); Debug.Log($"Adding new PlayerPawn {playerPawn.name}, playerType: {playerType} to {name}"); Debug.Log($"Adding new PlayerPawn {PlayerPawns.Count} {name}"); } public void ResetPlayerPawn(PlayerPawn movingPawn) { PlayerPawns.Remove(movingPawn); Debug.Log($"Resetting new PlayerPawn {movingPawn.name} {name}"); Debug.Log($"Resetting new PlayerPawn {PlayerPawns.Count} {name}"); } }