Package com.codingame.gameengine.core
Class AbstractReferee
java.lang.Object
com.codingame.gameengine.core.AbstractReferee
The Referee is the brain of your game, it implements all the rules and the turn order.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
AbstractReferee
public AbstractReferee()
-
-
Method Details
-
init
public abstract void init()Called on startup, this method exists to create the initial state of the game, according to the given input.
-
gameTurn
public abstract void gameTurn(int turn) Called on the computation of each turn of the game.A typical game turn:
- Send game information to each
Player
active on this turn. - Those players' code are
executed
. - Those players' inputs are read.
- The game logic is applied.
- Parameters:
turn
- which turn of the game is currently being computed. Starts at 1.
- Send game information to each
-
onEnd
public void onEnd()Optional.
This method is called once the final turn of the game is computed.Typically, this method is used to set the players' final scores according to the final state of the game.
-