|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.MapObject wyvern.lib.classes.games.ChessChair wyvern.lib.classes.games.CheckersChair
This class implements a chair you can sit in to play a Checkers game. It grabs control of your camera (so you can see the whole board) and forwards various commands along to the Checkers game.
Field Summary | |
protected int |
color_
|
protected java.lang.String |
colstring_
|
protected Chess |
game_
|
Fields inherited from class wyvern.kernel.maps.MapObject |
IN_MAP_EDITOR, listenerList_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
CheckersChair(Checkers game,
int color)
Constructs a new CheckersChair |
Method Summary | |
void |
apply(Commandable agent)
Someone applied the chair. |
CommandEvent |
createEvent(CommandEvent initial)
Creates the command event. |
boolean |
execute(CommandEvent event)
Executes the event. |
protected java.lang.String |
getGameName()
Returns the name of the game. |
void |
grabCamera(Player p)
Centers the player's camera on the chessboard, more or less. |
void |
hookEvent(java.lang.String hookName,
CommandEvent event)
Don't let the player move without quitting. |
void |
initialize()
Initializes the object's default properties. |
boolean |
knowsCommand(java.lang.String command)
Returns true if we understand the command. |
void |
relinquishCamera(Player p)
Puts the camera back under the control of the player. |
void |
remove()
Removes commands from the map. |
void |
setMap(GameMap map,
int x,
int y)
Sets up the commands we want to handle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Chess game_
protected int color_
protected java.lang.String colstring_
Constructor Detail |
public CheckersChair(Checkers game, int color)
game
- the Checkers game we're interacting withMethod Detail |
public void grabCamera(Player p)
p
- the player whose camera to moveprotected java.lang.String getGameName()
public boolean execute(CommandEvent event)
event
- the command event
public void initialize()
GameObject
initialize
in interface GameObject
initialize
in class MapObject
public void setMap(GameMap map, int x, int y)
setMap
in interface GameObject
setMap
in class MapObject
map
- the map we're inx
- map x locationy
- map y locationpublic void remove()
remove
in interface GameObject
remove
in class MapObject
public boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent initial)
createEvent
in interface Command
initial
- a "blank" CommandEvent containing only the
command text and the agent who's performing the command. This
initial event is created by the originator of the event (e.g.
the AI or player's command preprocessor).
public void relinquishCamera(Player p)
p
- the player whose camera to movepublic void hookEvent(java.lang.String hookName, CommandEvent event)
hookEvent
in interface HookCallback
hookName
- the name of the hook, such as "movePreHook".event
- the CommandEvent encapsulating the event parameterspublic void apply(Commandable agent)
apply
in interface Applyable
agent
- the person applying the object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |