Exemple #1
0
        public (bool, Coord) InstantiateToBenchStart(string name, EPlayer player)
        {
            for (int x = 0; x < 10; x++)
            {
                var y     = player.BenchId();
                var coord = new Coord(x, y);
                if (BenchUnits.ContainsKey(coord))
                {
                    continue;
                }

                BenchUnits[coord] = unitFactory.Create(name, coord, player);
                return(true, new Coord(x, y));
            }
            return(false, default);
 public static bool BelongsToPlayer(this Coord coord, EPlayer player) =>
 coord.Y == player.BenchId();