Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        public void PlayerDefeated(RiskPlayer p) 
        {
            Players.Remove(p);
            DefeatedPlayers.Add(p);


            /// Check for game over:

            if (Players.Count == 1)
            {
                State = new GameOver(this.State);
            }
        }
Exemplo n.º 3
0
 public GameOver(RiskGameState state) { Game = state.Game; }
Exemplo n.º 4
0
 public NormalTurnsGameState(RiskGameState t): this(t.Game) { }
Exemplo n.º 5
0
 public FirstReinforcementRound(RiskGameState state, Random rand) 
 {
     Game = state.Game;
 }
Exemplo n.º 6
0
 public HasEnoughPlayers(RiskGameState state) { Game = state.Game; }
Exemplo n.º 7
0
 public NotStarted(RiskGameState state) { Game = state.Game; }
Exemplo n.º 8
0
 public NormalTurnsGameState(RiskGameState state)
 {
     Game = state.Game;
     Turn = new NormalTurn(Game);        /// Start a normal turn
 }
Exemplo n.º 9
0
 public FirstReinforcementRound(RiskGameState state) { Game = state.Game; }