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); }
public void MovePiece(PointModel oldPoint, PointModel newPoint) { newPoint.Piece = oldPoint.Piece; oldPoint.Piece = null; PieceMoved(oldPoint, newPoint); }
public void ChangeSelection(PointModel point, bool isSelected) { point.Piece.IsSelected = isSelected; SelectionChanged(point, isSelected); }
public void RemovePiece(PointModel point) { point.Piece = null; PieceRemoved(point); }
public void PlaceNewPiece(PieceModel piece, PointModel point) { point.Piece = piece; NewPieceAdded(point); }
internal bool IsNeighbor(PointModel selectedPoint) { return(Neighbors.Contains(selectedPoint)); }