org.vizzini.game.boardgame
Interface IGridBoard

All Superinterfaces:
Cloneable, IEnvironment, Serializable
All Known Subinterfaces:
IChessEnvironment
All Known Implementing Classes:
AbstractChessEnvironment, AbstractGridBoard, DefaultChessEnvironment, DefaultGridBoard

public interface IGridBoard
extends IEnvironment

Defines methods required by grid board environments in the game framework.

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

Method Summary
 int agentTokenCount(IAgent agent, int startF, int startR, int startL, int df, int dr, int dl)
          Return the number of token's the given agent has in the line specified by the other arguments.
 int coordsToIndex(int file, int rank, int level)
          Return the index computed from the given parameters.
 IToken get(int file, int rank, int level)
          Return the token at the given position.
 int getCellCount()
          Return the cell count.
 int getFileCount()
          Return the file count.
 IAgent getLastAgent()
          Return the last agent who performed an action.
 int getLevelCount()
          Return the level count.
 int getMaxDimension()
          Return the maximum of the file, rank, and level counts.
 int getRankCount()
          Return the rank count.
 int indexToFile(int index)
          Return the file coordinates computed from the given index.
 int indexToLevel(int index)
          Return the level coordinates computed from the given index.
 IntegerPosition indexToPosition(int index)
          Return the position computed from the given index.
 int indexToRank(int index)
          Return the rank coordinates computed from the given index.
 boolean is3D()
          Return true if this is using 3D coordinates.
 boolean isActionHistoryUsed()
           
 boolean isPositionUsable(IntegerPosition position)
          Return true if the given position is usable.
 boolean isPositionUsable(int file, int rank, int level)
          Return true if the given position is usable.
 boolean isRedoAllowed()
          Return true if a redo action is allowed.
 boolean isUndoAllowed()
          Return true if an undo action is allowed.
 int positionToIndex(IntegerPosition position)
          Return the index computed from the given position.
 void setActionHistoryUsed(boolean isActionHistoryUsed)
           
 void setToken(IntegerPosition position, IToken token)
          Set the token at the given position.
 void setToken(int file, int rank, int level, IToken token)
          Set the token at the given position.
 
Methods inherited from interface org.vizzini.game.IEnvironment
addStateListener, clone, configure, copy, get, getAdjudicator, getAgentCollection, getTeamCollection, getTokenCollection, getTurnNumber, incrementTurnNumber, isFiringStateChanges, open, performAction, performActions, removeStateListener, reset, setAdjudicator, setAgentCollection, setFiringStateChanges, setTurnNumber, undoAction, update
 

Method Detail

isActionHistoryUsed

boolean isActionHistoryUsed()
Returns:
Return isActionHistoryUsed.
Since:
v0.3

agentTokenCount

int agentTokenCount(IAgent agent,
                    int startF,
                    int startR,
                    int startL,
                    int df,
                    int dr,
                    int dl)
Return the number of token's the given agent has in the line specified by the other arguments.

Parameters:
agent - Agent 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

coordsToIndex

int coordsToIndex(int file,
                  int rank,
                  int level)
Return the index computed from the given parameters.

Parameters:
file - File.
rank - Rank.
level - Level.
Returns:
The index, or -1 if the coordinates are out of range.

get

IToken get(int file,
           int rank,
           int level)
Return the token at the given position.

Since:
v0.1

getCellCount

int getCellCount()
Return the cell count.

Since:
v0.1

getFileCount

int getFileCount()
Return the file count.

Since:
v0.1

getLastAgent

IAgent getLastAgent()
Return the last agent who performed an action.

Since:
v0.1

getLevelCount

int getLevelCount()
Return the level count.

Since:
v0.1

getMaxDimension

int getMaxDimension()
Return the maximum of the file, rank, and level counts.

Since:
v0.2

getRankCount

int getRankCount()
Return the rank count.

Since:
v0.1

indexToFile

int indexToFile(int index)
Return the file coordinates computed from the given index.

Parameters:
index - Index.
Since:
v0.2

indexToLevel

int indexToLevel(int index)
Return the level coordinates computed from the given index.

Parameters:
index - Index.
Since:
v0.2

indexToPosition

IntegerPosition indexToPosition(int index)
Return the position computed from the given index.

Parameters:
index - Index.
Since:
v0.2

indexToRank

int indexToRank(int index)
Return the rank coordinates computed from the given index.

Parameters:
index - Index.
Since:
v0.2

is3D

boolean is3D()
Return true if this is using 3D coordinates.

Since:
v0.1

isPositionUsable

boolean isPositionUsable(IntegerPosition position)
Return true if the given position is usable.

Since:
v0.1

isPositionUsable

boolean isPositionUsable(int file,
                         int rank,
                         int level)
Return true if the given position is usable.

Since:
v0.1

isRedoAllowed

boolean isRedoAllowed()
Return true if a redo action is allowed.

Since:
v0.2

isUndoAllowed

boolean isUndoAllowed()
Return true if an undo action is allowed.

Since:
v0.2

positionToIndex

int positionToIndex(IntegerPosition position)
Return the index computed from the given position.

Parameters:
position - Position.
Since:
v0.2

setActionHistoryUsed

void setActionHistoryUsed(boolean isActionHistoryUsed)
Parameters:
isActionHistoryUsed - The isActionHistoryUsed to set.
Since:
v0.3

setToken

void setToken(IntegerPosition position,
              IToken token)
Set the token at the given position.

Parameters:
position - Position.
token - Token.
Since:
v0.1

setToken

void setToken(int file,
              int rank,
              int level,
              IToken token)
Set the token at the given position.

Parameters:
file - File.
rank - Rank.
level - Level.
token - Token.
Since:
v0.1


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