Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void PanelOnMouseDown(object sender, MouseEventArgs e)
- {
- if (_game.Board.SelectedPiece == null)
- {
- ChessPiece piece = _game.Board.GetPiece(e.Location, _ratio);
- if (piece != null)
- {
- _game.Board.SelectedPiece = piece;
- }
- }
- else
- {
- Point p = _game.Board.GetGridLocation(e.Location, _ratio);
- if (p != Point.Empty)
- {
- _game.MovePiece(_game.Board.SelectedPiece, p);
- }
- }
- }
Add Comment
Please, Sign In to add comment