/// <summary> /// Constructor /// </summary> /// <param name="xmlPath"></param> public RiskGame( string xmlPath ) { Board = new RiskBoard(xmlPath); Players = new List<RiskPlayer>(); PlayerTerritories = new List<PlayerTerritory>(); BoardTerritory[] tempArray = new BoardTerritory[Board.Territories.Count]; Board.Territories.CopyTo(tempArray); UnassignedTerritories = tempArray.ToList(); CurrentPlayerIndex = -1; State = new NotStarted(this); }
public void PlayerDefeated(RiskPlayer p) { Players.Remove(p); DefeatedPlayers.Add(p); /// Check for game over: if (Players.Count == 1) { State = new GameOver(this.State); } }
public GameOver(RiskGameState state) { Game = state.Game; }
public NormalTurnsGameState(RiskGameState t): this(t.Game) { }
public FirstReinforcementRound(RiskGameState state, Random rand) { Game = state.Game; }
public HasEnoughPlayers(RiskGameState state) { Game = state.Game; }
public NotStarted(RiskGameState state) { Game = state.Game; }
public NormalTurnsGameState(RiskGameState state) { Game = state.Game; Turn = new NormalTurn(Game); /// Start a normal turn }
public FirstReinforcementRound(RiskGameState state) { Game = state.Game; }