forked from fauvet/API_BUT5.5
67 lines
1.3 KiB
Java
67 lines
1.3 KiB
Java
package fr.iut_fbleau.raw_api_body.entity;
|
|
|
|
import java.util.Iterator;
|
|
|
|
/**
|
|
* The interface Plateau.
|
|
*/
|
|
public interface Plateau {
|
|
|
|
/**
|
|
* Return the current player
|
|
*
|
|
* @throws NullPointerException if the game is over
|
|
*
|
|
* @return the player
|
|
*/
|
|
Player getPlayer();
|
|
|
|
/**
|
|
* Return the game status
|
|
* - true if party is finished
|
|
* - false else
|
|
*
|
|
* @return the boolean
|
|
*/
|
|
boolean isFinished();
|
|
|
|
/**
|
|
* Return the result of a try
|
|
* - if the move is winnable : 1
|
|
* - if the move is a draw : 0
|
|
* - if its a defeat move : -1
|
|
*
|
|
* @throws NullPointerException if game is not over
|
|
*
|
|
* @return the result
|
|
*/
|
|
Result getResult();
|
|
|
|
/**
|
|
* List next legals moves
|
|
*
|
|
* @throws NullPointerException if the game is over
|
|
* @return the iterator
|
|
*/
|
|
Iterator<Ply> givePlies();
|
|
|
|
/**
|
|
* Play a future ply
|
|
*
|
|
* @throws IllegalArgumentException if the given ply is coming from wrong game
|
|
*
|
|
* @param ply the ply
|
|
*/
|
|
void doPly(Ply ply);
|
|
|
|
/**
|
|
* Removed a previous ply.
|
|
*
|
|
* @throws IllegalStateException if not allowed to come back on previous statement
|
|
*
|
|
* @param ply the ply
|
|
*/
|
|
void undoPly(Ply ply);
|
|
|
|
}
|