Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kestutis-Z
committed
Nov 27, 2012
1 parent
f48fc94
commit c94abc5
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
endgame-oracle/src/main/java/chess/patterns/ControllerEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package chess.patterns; | ||
|
||
import java.util.Set; | ||
|
||
import chess.ChessPosition; | ||
import chess.Square; | ||
|
||
/** | ||
* Chess entity that is able to control some other (controllable) chess entity . | ||
* Here "controling" means attacking all the squares that are in some way | ||
* related to the controllable entity, and that are of importance in chess play. | ||
* <br/> <br/> | ||
* | ||
* For example, in the pattern "White King defends White Rook", the White King | ||
* is the controller - it controls the square occupied by the White Rook. | ||
* | ||
* @author Kestutis | ||
* | ||
*/ | ||
public interface ControllerEntity extends ChessEntity { | ||
|
||
/** | ||
* Gets the squares that are controlled (attacked) by this controller entity. | ||
* | ||
* @param chessPosition representation of the chess position: side to move | ||
* (White / Black), White and Black pieces, and their respective squares | ||
* @return the set of control squares | ||
*/ | ||
public abstract Set<Square> getControlSquares(ChessPosition chessPosition); | ||
|
||
} |