+++ /dev/null
-/*
- * Copyright (c) 2018. Developed by Hedgecode.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.hedgecode.chess.position;
-
-import java.util.Map;
-
-/**
- *
- *
- * @author Dmitry Samoshin aka gotty
- */
-public interface Position {
-
- Map<Square, ColorPiece> getSquares();
-
- Map<Square, ColorPiece> getSquares(SquareSort sorting);
-
- Map<Square, ColorPiece> getSquarePieces(Color color);
-
- Map<Square, ColorPiece> getSquarePieces(Color color, Piece piece);
-
- void setPiece(Color color, Piece piece, Square square);
-
- void setPiece(ColorPiece colorPiece, Square square);
-
- Color getMove();
-
- void setMove(Color color);
-
- boolean isDiagram();
-
- Castle getCastle(Color color);
-
- void setCastle(Color color, Castle castle);
-
- Square getEnPassant();
-
- void setEnPassant(Square square);
-
- int getHalfMove();
-
- void setHalfMove(int count);
-
- int getFullMove();
-
- void setFullMove(int number);
-
- void initial();
-
- void clear();
-
- default void setPawn(Color color, Square square) {
- setPiece(color, Piece.PAWN, square);
- }
-
- default void setPawns(Color color, Square... squares) {
- for(Square square : squares)
- setPiece(color, Piece.PAWN, square);
- }
-
- default void setKnight(Color color, Square square) {
- setPiece(color, Piece.KNIGHT, square);
- }
-
- default void setBishop(Color color, Square square) {
- setPiece(color, Piece.BISHOP, square);
- }
-
- default void setRook(Color color, Square square) {
- setPiece(color, Piece.ROOK, square);
- }
-
- default void setQueen(Color color, Square square) {
- setPiece(color, Piece.QUEEN, square);
- }
-
- default void setKing(Color color, Square square) {
- setPiece(color, Piece.KING, square);
- }
-
-}