org.vizzini.game
Interface IAdjudicator

All Known Subinterfaces:
IChessAdjudicator, IGridBoardAdjudicator
All Known Implementing Classes:
AbstractAdjudicator, AbstractGridBoardAdjudicator, Adjudicator, Adjudicator, Adjudicator, Adjudicator, ChessAdjudicator, DefaultAdjudicator

public interface IAdjudicator

Defines methods required by adjudicators in the game framework. An adjudicator instance encapsulates the rules of a game by determining the legality of actions and when the game is over.

Since:
v0.1
Version:
v0.2
Author:
Jeffrey M. Thompson

Method Summary
 boolean areActionsLegal(IEnvironment environment, ActionCollection actions)
          Return true if the actions in the given list are legal in the given environment.
 IAgent getWinner()
          Return the winning agent, or null if there is no winner.
 boolean isActionLegal(IEnvironment environment, IAction action)
          Return true if the given action is legal in the given environment.
 boolean isGameOver(IEnvironment environment)
          Return true if the given environment represents a completed game.
 boolean isGoal(IEnvironment environment)
          Return true if one of the agents has won.
 void reset()
          Reset to the initial state.
 void setWinner(IAgent agent)
          Set the winning agent.
 

Method Detail

areActionsLegal

boolean areActionsLegal(IEnvironment environment,
                        ActionCollection actions)
Return true if the actions in the given list are legal in the given environment.

Parameters:
environment - The current environment.
actions - List of actions to evaluate.
Since:
v0.1

getWinner

IAgent getWinner()
Return the winning agent, or null if there is no winner.

Since:
v0.1

isActionLegal

boolean isActionLegal(IEnvironment environment,
                      IAction action)
Return true if the given action is legal in the given environment.

Parameters:
environment - The current environment.
Returns:
true if the given action is legal in the given environment.
Since:
v0.1

isGameOver

boolean isGameOver(IEnvironment environment)
Return true if the given environment represents a completed game.

Parameters:
environment - The current environment.
Since:
v0.1

isGoal

boolean isGoal(IEnvironment environment)
Return true if one of the agents has won. If no one has won, return false.

Since:
v0.1

reset

void reset()
Reset to the initial state.

Since:
v0.1

setWinner

void setWinner(IAgent agent)
Set the winning agent.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02