ctf.environment
Class FlagGrid
java.lang.Object
|
+--ctf.environment.Grid
|
+--ctf.environment.SingletonGrid
|
+--ctf.environment.FlagGrid
- class FlagGrid
- extends SingletonGrid
Flag grid for game of capture the flag. Only one flag per grid.
(A separate grid should be used for each team.)
Note that this class only has package access enabled.
- Author:
- Jason Rohrer
Constructor Summary |
(package private) |
FlagGrid(int inBoardSize,
Color inLineColor,
Color inFillColor,
Color inFlagClothColor)
Constructs a FlagGrid . |
Method Summary |
protected void |
drawObject(Graphics inGraphics,
int inStartX,
int inStartY,
int inWide,
int inHigh)
Draws a graphical representation of an object in a specific location
in a graphics context. |
void |
setFlagClothColor(Color inFlagClothColor)
Set fill color for drawing flag cloth. |
Methods inherited from class ctf.environment.Grid |
add,
add,
clear,
draw,
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 |
FlagGrid
FlagGrid(int inBoardSize,
Color inLineColor,
Color inFillColor,
Color inFlagClothColor)
- Constructs a
FlagGrid
.
- Parameters:
inBoardSize
- dimension of grid.inLineColor
- line color for drawing objects in this grid.inFillColor
- fill color for drawing objects in this grid.inFlagClothColor
- fill color for the cloth part of the flag.
setFlagClothColor
public void setFlagClothColor(Color inFlagClothColor)
- Set fill color for drawing flag cloth.
- Parameters:
inFillColor
- fill color for flag cloth.
drawObject
protected void drawObject(Graphics inGraphics,
int inStartX,
int inStartY,
int inWide,
int inHigh)
- Description copied from class: Grid
- Draws a graphical representation of an object in a specific location
in a graphics context. To be implemented by all non-abstract subclasses
for drawing graphical representations of particular kinds of grid
objects.
- Overrides:
- drawObject in class Grid
- Tags copied from class: Grid
- Parameters:
inGraphics
- the graphics context in which to draw the object.inStartX
- the starting x coordinate in inGraphics
for the object.inStartY
- the starting y coordinate in inGraphics
for the object.inWide
- the width of the object image.inHigh
- the height of the object image.