예제 #1
0
        public void RestoreState(BoardMemento memento)
        {
            if (this.col != memento.col || this.row != memento.row)
            {
                throw new ArgumentException();
            }

            for (int i = 0; i < memento.row; i++)
            {
                for (int j = 0; j < memento.col; j++)
                {
                    this.cards[i, j] = memento.cards[i * memento.col + j];
                }
            }
            this.FirstUpCard = memento.firstUpCard;
        }
예제 #2
0
 public void AddMemento(BoardMemento memento)
 {
     //History.Push(formatter.Serialize());
 }