Beispiel #1
0
 public void SelectCursorPosition(PieceColor currentPlayer)
 {
     if (PieceSelection.moveOptions.Contains(_cursor.getCoordinates()))
     {
         var start = PieceSelection.piece.Coordinates;
         var end   = _cursor.getCoordinates();
         var piece = PieceSelection.piece;
         _moveSelectedPiece(_cursor.getCoordinates());
         var memento = new BoardMemento(piece, start, end);
         var payload = new EndTurnEventArgs(memento);
         OnEndTurn(payload);
     }
     else
     {
         _selectCursorPiece(currentPlayer);
     }
 }
Beispiel #2
0
 public void OnEndTurn(object source, EndTurnEventArgs e)
 {
     _history.Push(e.Memento);
     _currentPlayer = _currentPlayer.GetOpposingColor();
 }