private bool HandleRemovePiece(PointModel pointModel, Point currentPoint)
        {
            if (!CanRemovePiece(pointModel))
            {
                return(false);
            }

            if (IsPieceInMill(pointModel.Piece))
            {
                NotifyUser(cannotRemovePieceMessage);
                return(true);
            }

            RemovePiece(pointModel);

            if (IsGameOver())
            {
                NotifyUser(string.Format(gameOverMessage, gameModel.CurrentPlayer.Number));
                return(true);
            }

            TakeTurn();
            return(true);
        }
Beispiel #2
0
 public void MovePiece(PointModel oldPoint, PointModel newPoint)
 {
     newPoint.Piece = oldPoint.Piece;
     oldPoint.Piece = null;
     PieceMoved(oldPoint, newPoint);
 }
Beispiel #3
0
 public void ChangeSelection(PointModel point, bool isSelected)
 {
     point.Piece.IsSelected = isSelected;
     SelectionChanged(point, isSelected);
 }
Beispiel #4
0
 public void RemovePiece(PointModel point)
 {
     point.Piece = null;
     PieceRemoved(point);
 }
Beispiel #5
0
 public void PlaceNewPiece(PieceModel piece, PointModel point)
 {
     point.Piece = piece;
     NewPieceAdded(point);
 }
Beispiel #6
0
 internal bool IsNeighbor(PointModel selectedPoint)
 {
     return(Neighbors.Contains(selectedPoint));
 }