|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.motion.PushCommand
This command implements pushing objects around. It shares some of the semantics of movement, including the complex checks for whether the agent can move into the destination square, which is why it's in the kernel.
Nested Class Summary | |
class |
PushCommand.PushEvent
Inner class for encapsulating a Push event. |
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Adds known commands. |
CommandEvent |
createEvent(CommandEvent initial)
Creates a PushEvent from scratch. |
CommandEvent |
createFromMove(MoveEvent move,
Point target,
GameObject pushable,
Predicate pp)
Mogrifies a MoveEvent into a PushEvent. |
boolean |
execute(CommandEvent event)
Executes the push. |
static PushCommand |
getImpl()
|
boolean |
knowsCommand(java.lang.String cmd)
Returns 'true' for handling "push". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static PushCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
addCommands
in interface BuiltInCommand
commands
- a Map whose keys are commands, and whose values
are Commands that handle those commands.list
- the CommandList the Command is being added to.public boolean knowsCommand(java.lang.String cmd)
knowsCommand
in interface Command
cmd
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent initial)
createEvent
in interface Command
initial
- the CommandEvent that started this push.
It's a generic event used to hold the command arguments.
public CommandEvent createFromMove(MoveEvent move, Point target, GameObject pushable, Predicate pp)
move
- the MoveEvent in whose destination list the
ContactManager found a pushable object.target
- the map location of the pushable objectpushable
- the pushable object we foundpp
- a PropertyPredicate instance that checks for "pushable"public boolean execute(CommandEvent event)
execute
in interface Command
event
- the PushEvent to execute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |