// Retire une unité du jeu public void deleteUnit(int idPlayer, Unit unit) { List <Unit> unitsList; UnitsDictionary.TryGetValue(idPlayer, out unitsList); unitsList.Remove(unit); if (unitsList.Count == 0) { // On met fin à la partie EndTurnCommand etd = new EndTurnCommand(true); etd.execute(); } }
public void nextTurn() { EndTurnCommand etd; if (CurrentTurn == MaxTurn) { // On met fin à la partie etd = new EndTurnCommand(true); etd.execute(); return; } etd = new EndTurnCommand(false); etd.execute(); CurrentPlayer = 1; UnitCounterTurn = 0; nextUnit(); }
public bool Equals(EndTurnCommand etc) { // If parameter is null return false: if ((object)etc == null) { return(false); } if (IsLastTurn != etc.IsLastTurn) { return(false); } if (NbTurn != etc.NbTurn) { return(false); } // Return true if the fields match: return(true); }