wyvern.lib.commands
Class FriendsCommand

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.commands.SimpleHandler
          extended bywyvern.lib.commands.FriendsCommand
All Implemented Interfaces:
BuiltInCommand, Command, PropertyList

public class FriendsCommand
extends SimpleHandler

Manages a list of friends.

Version:
1.0, Aug 23, 2003
Author:
Steve Yegge

Field Summary
static int MAX_FRIENDS
          To keep the friend lists from getting too long, we impose a maximum number.
 
Fields inherited from class wyvern.kernel.commands.SimpleHandler
delay_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Method Summary
 void addCommands(java.util.Map commands, CommandList list)
          Adds our commands.
 boolean addFriends(CommandEvent event)
          Adds some friends to the list.
 boolean friends(CommandEvent event)
          Manages a list of friends.
static boolean friendsWith(Player A, Player B)
          Returns true if player A has player B in his/her friends list.
 boolean friendtell(CommandEvent event)
          Does a friend-tell.
 boolean friendwho(CommandEvent event)
          Shows which of your friends are currently online.
static FriendsCommand getImpl()
           
 boolean handleEvent(CommandEvent event)
          Modifies or views the startup-cmds list.
 boolean invite(CommandEvent event)
          Invites a player into your map.
 boolean listFriends(Commandable agent)
          Tells the agent their friends.
 boolean removeFriends(CommandEvent event)
          Removes one or more friends from the list.
 boolean uninvite(CommandEvent event)
          Uninvites a player.
 
Methods inherited from class wyvern.kernel.commands.SimpleHandler
createEvent, execute, knowsCommand
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_FRIENDS

public static final int MAX_FRIENDS
To keep the friend lists from getting too long, we impose a maximum number.

See Also:
Constant Field Values
Method Detail

getImpl

public static FriendsCommand getImpl()

addCommands

public void addCommands(java.util.Map commands,
                        CommandList list)
Description copied from class: SimpleHandler
Adds our commands. Subclasses should override this and, for each command the subclass wants to implement, put it in the "commands" map.

Specified by:
addCommands in interface BuiltInCommand
Specified by:
addCommands in class SimpleHandler
Parameters:
commands - a Map whose keys are the command verbs, and whose values are references to the SimpleHandler instance that wants to handle the command.
list - the Player, Monster, Vehicle or other CommandList implementation for which addCommands() is being called.

handleEvent

public boolean handleEvent(CommandEvent event)
Modifies or views the startup-cmds list.

Specified by:
handleEvent in class SimpleHandler
Parameters:
event - a CommandEvent with various fields filled in: the agent performing the command, the command verb and arguments, the delay for the command, and success/failure messages.
Returns:
true if it was completed successfully

invite

public boolean invite(CommandEvent event)
Invites a player into your map. Lasts until you log out.


uninvite

public boolean uninvite(CommandEvent event)
Uninvites a player.


friends

public boolean friends(CommandEvent event)
Manages a list of friends.


listFriends

public boolean listFriends(Commandable agent)
Tells the agent their friends.


addFriends

public boolean addFriends(CommandEvent event)
Adds some friends to the list.


removeFriends

public boolean removeFriends(CommandEvent event)
Removes one or more friends from the list.


friendtell

public boolean friendtell(CommandEvent event)
Does a friend-tell.


friendwho

public boolean friendwho(CommandEvent event)
Shows which of your friends are currently online.


friendsWith

public static boolean friendsWith(Player A,
                                  Player B)
Returns true if player A has player B in his/her friends list.