Exemplo n.º 1
0
 /// <summary>
 /// Restores the game to a saved state
 /// </summary>
 /// <param name="state"></param>
 private void RestoreFromState(InstantGameState state)
 {
     this.CurrentGameState = state.GameState;
     this._NextPlayerIndex = state.NextPlayerIndex;
 }
Exemplo n.º 2
0
 /// <summary>
 /// append an state to the list of states
 /// </summary>
 /// <param name="state"></param>
 private void AppendState(IGameState state)
 {
     InstantGameState gamephoto = new InstantGameState();
     gamephoto.NextPlayerIndex = _NextPlayerIndex;
     gamephoto.GameState = state;
     if (_CurrentStateIndex<StateList.Count - 1)
     {
         StateList.RemoveRange(_CurrentStateIndex+1,StateList.Count - _CurrentStateIndex);
         StateList.Add(gamephoto);
     }
     else
     {
         StateList.Add(gamephoto);
         _CurrentStateIndex++;
     }
 }