org.vizzini.game.boardgame
Class AbstractGridBoardAdjudicator

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

public abstract class AbstractGridBoardAdjudicator
extends AbstractAdjudicator
implements IGridBoardAdjudicator

Provides base functionality for grid board adjudicators in the game framework.

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

Field Summary
 
Fields inherited from class org.vizzini.game.AbstractAdjudicator
_winner
 
Constructor Summary
AbstractGridBoardAdjudicator()
           
 
Method Summary
 boolean agentHasLine(IEnvironment environment, IAgent agent0, IAgent agent1, int startF, int startR, int startL, int df, int dr, int dl)
          Return true if an agent has tokens in the line specified by the other arguments.
 boolean agentHasLineHelper(IGridBoard board, IAgent agent, int startF, int startR, int startL, int df, int dr, int dl)
          Return true if an agent has tokens in the line specified by the other arguments.
 Set getWinningPositions()
           
 
Methods inherited from class org.vizzini.game.AbstractAdjudicator
areActionsLegal, getWinner, reset, setWinner
 
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
areActionsLegal, getWinner, isActionLegal, isGameOver, isGoal, reset, setWinner
 

Constructor Detail

AbstractGridBoardAdjudicator

public AbstractGridBoardAdjudicator()
Method Detail

agentHasLine

public boolean agentHasLine(IEnvironment environment,
                            IAgent agent0,
                            IAgent agent1,
                            int startF,
                            int startR,
                            int startL,
                            int df,
                            int dr,
                            int dl)
Return true if an agent has tokens in the line specified by the other arguments.

Specified by:
agentHasLine in interface IGridBoardAdjudicator
Parameters:
environment - Environment of interest.
startF - Starting file.
startR - Starting rank.
startL - Starting level.
df - Delta in the file direction.
dr - Delta in the rank direction.
dl - Delta in the level direction.
agent0 - First agent.
agent1 - Second agent.
Since:
v0.2

agentHasLineHelper

public boolean agentHasLineHelper(IGridBoard board,
                                  IAgent agent,
                                  int startF,
                                  int startR,
                                  int startL,
                                  int df,
                                  int dr,
                                  int dl)
Return true if an agent has tokens in the line specified by the other arguments.

Parameters:
board - Board of interest.
startF - Starting file.
startR - Starting rank.
startL - Starting level.
df - Delta in the file direction.
dr - Delta in the rank direction.
dl - Delta in the level direction.
Since:
v0.2

getWinningPositions

public Set getWinningPositions()
Specified by:
getWinningPositions in interface IGridBoardAdjudicator
Returns:
Return winningPositions.


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