2 * Copyright (c) 2018. Developed by Hedgecode.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.hedgecode.chess.position;
24 * @author Dmitry Samoshin aka gotty
26 public interface Position {
28 Map<Square, ColorPiece> getSquares();
30 Map<Square, ColorPiece> getSquares(SquareSort sorting);
32 Map<Square, ColorPiece> getSquarePieces(Color color);
34 Map<Square, ColorPiece> getSquarePieces(Color color, Piece piece);
36 void setPiece(Color color, Piece piece, Square square);
38 void setPiece(ColorPiece colorPiece, Square square);
42 void setMove(Color color);
46 Castle getCastle(Color color);
48 void setCastle(Color color, Castle castle);
50 Square getEnPassant();
52 void setEnPassant(Square square);
56 void setHalfMove(int count);
60 void setFullMove(int number);
66 default void setPawn(Color color, Square square) {
67 setPiece(color, Piece.PAWN, square);
70 default void setPawns(Color color, Square... squares) {
71 for(Square square : squares)
72 setPiece(color, Piece.PAWN, square);
75 default void setKnight(Color color, Square square) {
76 setPiece(color, Piece.KNIGHT, square);
79 default void setBishop(Color color, Square square) {
80 setPiece(color, Piece.BISHOP, square);
83 default void setRook(Color color, Square square) {
84 setPiece(color, Piece.ROOK, square);
87 default void setQueen(Color color, Square square) {
88 setPiece(color, Piece.QUEEN, square);
91 default void setKing(Color color, Square square) {
92 setPiece(color, Piece.KING, square);