ctf.environment
Class SingletonGrid

java.lang.Object
  |
  +--ctf.environment.Grid
        |
        +--ctf.environment.SingletonGrid
Direct Known Subclasses:
BaseGrid, FlagGrid

abstract class SingletonGrid
extends Grid

Grid that supports exactly one existing object. Note that this class only has package access enabled.

Author:
Jason Rohrer

Fields inherited from class ctf.environment.Grid
mFillColor, mLineColor
 
Constructor Summary
protected SingletonGrid(int inBoardSize, Color inLineColor, Color inFillColor)
          Constructs a SingletonGrid.
 
Method Summary
(package private)  EnvironmentLocation getLocation()
          Get object location.
(package private)  void setLocation(EnvironmentLocation inLocation)
          Set object location.
(package private)  void setLocation(int inX, int inY)
          Set object location.
 
Methods inherited from class ctf.environment.Grid
add, add, clear, draw, drawObject, exists, exists, getDrawDimension, remove, remove, setFillColor, setLineColor
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonGrid

protected SingletonGrid(int inBoardSize,
                        Color inLineColor,
                        Color inFillColor)
Constructs a SingletonGrid.
Parameters:
inBoardSize - dimension of grid.
inLineColor - line color for drawing objects in this grid.
inFillColor - fill color for drawing objects in this grid.
Method Detail

setLocation

void setLocation(int inX,
                 int inY)
Set object location.
Parameters:
inX - x coordinate of object location.
inY - y coordinate of object location.

setLocation

void setLocation(EnvironmentLocation inLocation)
Set object location.
Parameters:
inLocation - new location of object.

getLocation

EnvironmentLocation getLocation()
Get object location.
Returns:
location of base in grid.