Ejemplo n.º 1
0
        private void AddHistory(BoardState state)
        {
            if (_currentStateId > 0)
            {
                //Console.WriteLine(_currentStateId );

                while (History.States.Count > _currentStateId)
                {
                    History.States.RemoveAt(History.States.Count - 1);
                }

                //history = new GameHistory {States = new List<BoardState>(history.States.GetRange(0, _currentStateId))};
                _currentStateId = 0;
            }

            //history = GameHistory.DeepClone(history);
            History.States.Add(BoardState.DeepClone(state));
        }
Ejemplo n.º 2
0
 public void GoToState(int i)
 {
     State           = BoardState.DeepClone(History.States[i]);
     _currentStateId = i + 1;
 }