org.vizzini.game
Class AbstractAdjudicator

java.lang.Object
  extended by org.vizzini.game.AbstractAdjudicator
All Implemented Interfaces:
IAdjudicator
Direct Known Subclasses:
AbstractGridBoardAdjudicator, Adjudicator, Adjudicator, ChessAdjudicator, DefaultAdjudicator

public abstract class AbstractAdjudicator
extends Object
implements IAdjudicator

Provides base functionality for 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

Field Summary
protected  IAgent _winner
          The winning agent.
 
Constructor Summary
AbstractAdjudicator()
          Construct this object.
 
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.
 void reset()
          Reset to the initial state.
 void setWinner(IAgent agent)
          Set the winning agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.IAdjudicator
isActionLegal, isGameOver, isGoal
 

Field Detail

_winner

protected IAgent _winner
The winning agent.

Constructor Detail

AbstractAdjudicator

public AbstractAdjudicator()
Construct this object.

Since:
v0.2
Method Detail

areActionsLegal

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

Specified by:
areActionsLegal in interface IAdjudicator
Parameters:
environment - The current environment.
actions - List of actions to evaluate.
Since:
v0.1

getWinner

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

Specified by:
getWinner in interface IAdjudicator
Since:
v0.1

reset

public void reset()
Reset to the initial state.

Specified by:
reset in interface IAdjudicator
Since:
v0.1

setWinner

public void setWinner(IAgent agent)
Set the winning agent.

Specified by:
setWinner in interface IAdjudicator
Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02