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); } } }
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); }
public bool DeployDoll(Doll doll) { return(DeployDoll(doll, factions[currentFactionIndex])); }