|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.AtmosphereCommands
This class handles performing standard atmospheres.
Atmospheres come in several varieties:
Method Summary | |
CommandEvent |
createEvent(CommandEvent event)
Creates a CommandEvent that encapsulates all the state necessary to perform the command. |
CommandEvent |
createEvent(CommandEvent event,
Atmospheres atmo)
Creates an event with the specified Atmospheres object. |
boolean |
execute(CommandEvent event)
Implements Command.execute() |
static AtmosphereCommands |
getImpl()
|
void |
handleAdjacent(Monster agent,
java.lang.String name,
java.lang.String verb,
java.lang.String gender,
CommandEvent event)
Sets up the messages for a adjacent atmosphere. |
void |
handleSolo(Monster agent,
java.lang.String name,
java.lang.String verb,
java.lang.String gender,
CommandEvent event)
Sets up the messages for a solo atmosphere. |
void |
handleVisible(Monster agent,
java.lang.String name,
java.lang.String verb,
java.lang.String gender,
CommandEvent event)
Sets up the messages for a visible atmosphere. |
boolean |
knowsCommand(java.lang.String command)
Returns true if this Command wants to handle the command. |
boolean |
printAtmospheres(CommandEvent event)
Prints a list of all available atmospheres to the agent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static AtmosphereCommands getImpl()
public boolean knowsCommand(java.lang.String command)
Command
This method exists to allow more than one game object to implement the same command verb, but with different expected arguments.
If two objects register for the same command and the same arguments, the object that was registered most recently gets to handle at the command.
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent event)
Command
This method is called by the kernel. The kernel passes the event to the pre-hook, then calls Command.execute() (below) to execute the event, and finally calls the post-hook.
createEvent
in interface Command
event
- 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 CommandEvent createEvent(CommandEvent event, Atmospheres atmo)
atmo
- the Atmospheres object that knows what
Atmospheres we consider valid for this event.public void handleSolo(Monster agent, java.lang.String name, java.lang.String verb, java.lang.String gender, CommandEvent event)
agent
- the agentname
- agent.getName()verb
- the atmospheregender
- agent's gender pronoun ("his", "her" or "its")event
- the event
public void handleAdjacent(Monster agent, java.lang.String name, java.lang.String verb, java.lang.String gender, CommandEvent event)
agent
- the agentname
- agent.getName()verb
- the atmospheregender
- agent's gender pronoun ("his", "her" or "its")event
- the event
public void handleVisible(Monster agent, java.lang.String name, java.lang.String verb, java.lang.String gender, CommandEvent event)
agent
- the agentname
- agent.getName()verb
- the atmospheregender
- agent's gender pronoun ("his", "her" or "its")event
- the event
public boolean execute(CommandEvent event)
event
- the CommandEvent to execute
Command.execute(wyvern.lib.CommandEvent)
public boolean printAtmospheres(CommandEvent event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |