|
Engine
Information on the algorithms used in the cathedral game engine
Phase-Design IntroductionThe cathedral engine has a few important methods. This page will describe the algorithms used for a few of these methods. Details/**
* A interface that could be the core engine for almost any language.
*
* @author Scott Finlay
*
*/
public interface CathedralEngine {
/**
* Get a set of the available peices to play.
*
* Can be used to determine whats left at the end of the game.
*/
public Set<Peice> getAvaliablePeices();
/**
* Start a new game, reset everything.
*/
public void reset();
/**
* A list of the history moves.
*
* "WCAwF5,BINnA3*,WBRwE1!" where * means a capture, and ! means game over
* @return a list of the moves.
*/
public List<Move> getHistory();
/**
* Check to see if the move is valid.
*
* Used for doing stuff when hovering above squares to highlight them,
* and can be used rapidly.
*
* @return true if its a valid move
*/
public boolean isValidMove(Peice peice, String square, String orientation);
/**
* Validates the move then plays the peice
*
* @return true if peice captured
*/
public boolean move(Peice peice, String square, String orientation) throws InvalidMoveException;
/**
* Check to see if the game is over
*
* @return true if the game is over
*/
public boolean isGameOver();
}isValidMove(peice, square, orientation)A few steps need to happen to get it to work.
move(peice, square, orientation)
|