Exemplo n.º 1
0
 public Doll Battle(Doll d1, Doll d2)
 {
     if (d1.type == Doll.DollType.Bomb || d2.type == Doll.DollType.Bomb)
     {
         return(null);
     }
     else
     {
         if ((int)d1.type > (int)d2.type)
         {
             return(d1);
         }
         else if ((int)d1.type < (int)d2.type)
         {
             return(d2);
         }
         else
         {
             return(null);
         }
     }
 }
Exemplo n.º 2
0
        public bool DeployDoll(Doll doll, Faction faction)
        {
            Grid hq = null;

            for (int i = 0; i < board.grids.GetLength(0); i++)
            {
                for (int j = 0; j < board.grids.GetLength(1); j++)
                {
                    if (board[i, j].type == Grid.GridType.HQ && board[i, j].faction == factions[currentFactionIndex])
                    {
                        hq = board[i, j];
                    }
                }
            }
            if (hq == null || hq.doll != null || factions[currentFactionIndex].supply < Doll.deployCost[(int)doll.type])
            {
                return(false);
            }

            factions[currentFactionIndex].supply -= Doll.deployCost[(int)doll.type];
            hq.doll = doll;
            return(true);
        }
Exemplo n.º 3
0
 public bool DeployDoll(Doll doll)
 {
     return(DeployDoll(doll, factions[currentFactionIndex]));
 }