wyvern.lib.skills
Class HalflingSkills

java.lang.Object
  extended bywyvern.lib.skills.HalflingSkills
All Implemented Interfaces:
AddRemoveNotify, Command, MutableProperty

public class HalflingSkills
extends java.lang.Object
implements AddRemoveNotify, Command, MutableProperty

Implements the "hide" and "unhide" commands.

Version:
1.0, Oct 9, 2002
Author:
Steve Yegge

Constructor Summary
HalflingSkills()
           
 
Method Summary
 java.lang.Object createClone()
          Produces a clone of the property for the caller.
 CommandEvent createEvent(CommandEvent e)
          Creates a CommandEvent that encapsulates all the state necessary to perform the command.
 boolean equals(java.lang.Object o)
           
 boolean execute(CommandEvent event)
          Executes the specified CommandEvent.
 int hashCode()
           
 boolean knowsCommand(java.lang.String cmd)
          Returns true if this Command wants to handle the command.
 void notifyAdd(PropertyList obj)
          Notifies the property that it's being added to a PropertyList.
 void notifyRemove(PropertyList obj)
          Notifies the property that it's being removed from a PropertyList.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HalflingSkills

public HalflingSkills()
Method Detail

notifyAdd

public void notifyAdd(PropertyList obj)
Description copied from interface: AddRemoveNotify
Notifies the property that it's being added to a PropertyList.

You should never assume that the passed value is a GameObject. Make sure to test it with instanceof (Java) or isInstance (Jython) first. Properties are added to Archetypes as well as GameObjects, so your AddRemoveNotify is likely to be called for both cases.

Specified by:
notifyAdd in interface AddRemoveNotify
Parameters:
obj - the PropertyList whose property list we're being added to

notifyRemove

public void notifyRemove(PropertyList obj)
Description copied from interface: AddRemoveNotify
Notifies the property that it's being removed from a PropertyList.

You should never assume that the passed value is a GameObject. Make sure to test it with instanceof (Java) or isInstance (Jython) first. Properties are added to Archetypes as well as GameObjects, so your AddRemoveNotify is likely to be called for both cases.

Specified by:
notifyRemove in interface AddRemoveNotify
Parameters:
obj - the PropertyList we're being removed from

knowsCommand

public boolean knowsCommand(java.lang.String cmd)
Description copied from interface: Command
Returns true if this Command wants to handle the command. The Command can examine the arguments and determine that it doesn't actually understand the command, in which case it should return false.

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.

Specified by:
knowsCommand in interface Command
Parameters:
cmd - the entire command string, including arguments
Returns:
true if we want to handle the command

createEvent

public CommandEvent createEvent(CommandEvent e)
Description copied from interface: Command
Creates a CommandEvent that encapsulates all the state necessary to perform the command. A well-designed CommandEvent exposes all of its "properties" so that hook objects can modify its behavior. For instance, many commands result in some sort of message being sent back to the client. The message should be among the properties that hooks can override.

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.

Specified by:
createEvent in interface Command
Parameters:
e - 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).
Returns:
a CommandEvent subclass encapsulating this command's execution parameters and state. It should copy in the fields from the passed-in event.

execute

public boolean execute(CommandEvent event)
Description copied from interface: Command
Executes the specified CommandEvent. The CommandEvent contains all the parameters and state required to execute the command; the parameters have been filtered through hook objects, so they may not be the same as when the event was created.

Specified by:
execute in interface Command
Parameters:
event - the CommandEvent to execute
Returns:
true if the event completed successfully, else false.

createClone

public java.lang.Object createClone()
Description copied from interface: MutableProperty
Produces a clone of the property for the caller. Note: it's called createClone, not makeClone, because GameObject already has a makeClone. Some GameObjects can be properties (e.g inventories) and we can't do overloaded methods based only on the return type.

Specified by:
createClone in interface MutableProperty

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()