Marauroa Core API: Difference between revisions

Content deleted Content added
imported>Hendrik Brummermann
imported>Hendrik Brummermann
Line 284:
 
=IRPRuleProcessor=
This class *MUST*must be implemented fully, but it is a childs toy compared to IRPZone :). This is where you code all your games rules.<br>
The API is as follows:
<source lang="java">
<pre>
/** Set the context where the actions are executed.
* @param zone The zone where actions happens. */
public void setContext(IRPZone zone);
 
/** Pass the whole list of actions so that it can approve or deny the actions in it.
* @param id the id of the object owner of the actions.
* @param actionList the list of actions that the player wants to execute. */
public void approvedActions(RPObject.ID id, RPActionList actionList);
 
/** Execute an action in the name of a player.
* @param id the id of the object owner of the actions.
Line 300 ⟶ 302:
* refer to Actions Explained for more info. */
public RPAction.Status execute(RPObject.ID id, RPAction action);
 
/** Notify it when a new turn happens */
public void nextTurn();
 
/** Callback method called when a new player enters in the game
* @param object the new player that enters in the game. */
public boolean onInit(RPObject object) throws RPObjectInvalidException;
 
/** Callback method called when a new player exits the game
* @param id the new player id that exits the game.
* @return true to update the player on database. */
public boolean onExit(RPObject.ID id) throws RPObjectNotFoundException;
 
/** Callback method called when a new player time out
* @param id the new player id that timeouts. */
public boolean onTimeout(RPObject.ID id) throws RPObjectNotFoundException;
</presource>
 
[[Category:Marauroa]]