mstar
Class Commands

java.lang.Object
  |
  +--mstar.Commands
Direct Known Subclasses:
TinyMudCommands

public abstract class Commands
extends java.lang.Object

Commands is an abstract base class for creating a high-level representation of commands for MUD's, MOO's, MUSHes, and other collaborative environments. Each command that is generated from this class is only responsible for sending the command to the collaborative environment.

Version:
1.6
Author:
Thaddeus O. Cooper (cooper@tweenproject.org)

Constructor Summary
Commands()
          Constructs a command class with no input or output streams defined.
Commands(java.io.DataInputStream in, java.io.PrintStream out)
          Constructs a command class and defines the input and output streams for the collaborative environment.
 
Method Summary
abstract  void describe(java.lang.String description)
          Sends the describe command to the collaborative environment.
abstract  void emote(java.lang.String who, java.lang.String what)
          Sends an emote command to the collaborative environment.
abstract  java.lang.String getHowPages()
          Deprecated.  
abstract  java.lang.String getHowSays()
          Deprecated.  
abstract  java.lang.String getHowWhispers()
          Deprecated.  
 java.io.DataInputStream getInputStream()
          Gets the input stream to listen to the collaborative environment on.
 java.io.PrintStream getOutputStream()
          Gets the output stream to write to the collaborative environment on.
abstract  void go(java.lang.String where)
          Send the go command to the collaborative environment.
abstract  void goHome()
          A special case of the go command to send a player back to his or her default room in the collaborative environment.
abstract  void inventory()
          Sends the inventory command to the collaborative environment.
abstract  void look(java.lang.String at)
          Send the look command to the collaborative environment.
abstract  void mutter(java.lang.String who, java.lang.String what)
          Sends a muttered message to everyone except the character in the collaborative environment.
abstract  void page(java.lang.String who, java.lang.String what)
          Sends a page to a specific character in the collaborative environment.
abstract  void pose(java.lang.String what)
          Send the pose command to the collaborative environment.
abstract  void quit()
          Sends the command to the collaborative environment to end the current session.
abstract  void say(java.lang.String what)
          Send the say command to the collaborative environment.
abstract  void set(java.lang.String what, java.lang.String flag)
          Sends the set command to the collaborative environment.
 void setInputStream(java.io.DataInputStream in)
          Sets the input stream to listen to the collaborative environment on.
abstract  void setOutputPrefix(java.lang.String what)
          Sends the OUTPUTPREFIX command to the collaborative environment.
 void setOutputStream(java.io.PrintStream out)
          Sets the output stream to write to the collaborative environment on.
abstract  void setOutputSuffix(java.lang.String what)
          Sends the OUTPUTSUFFIX command to the collaborative environment.
abstract  void whisper(java.lang.String who, java.lang.String what)
          Sends a whispered message to a specific character in the collaborative environment.
abstract  void yell(java.lang.String what)
          Send the yell command to the collaborative environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Commands

public Commands()
Constructs a command class with no input or output streams defined.

Commands

public Commands(java.io.DataInputStream in,
                java.io.PrintStream out)
Constructs a command class and defines the input and output streams for the collaborative environment.
Parameters:
in - the stream to listen to the collaborative environment on.
out - the stream to write to the collaborative environment on.
Method Detail

setInputStream

public void setInputStream(java.io.DataInputStream in)
Sets the input stream to listen to the collaborative environment on.
Parameters:
in - the stream to listen to the collaborative environment on.

getInputStream

public java.io.DataInputStream getInputStream()
Gets the input stream to listen to the collaborative environment on.
Returns:
the stream to listen to the collaborative environment on.

setOutputStream

public void setOutputStream(java.io.PrintStream out)
Sets the output stream to write to the collaborative environment on.
Parameters:
out - the stream to write to the collaborative environment on.

getOutputStream

public java.io.PrintStream getOutputStream()
Gets the output stream to write to the collaborative environment on.
Returns:
the stream to write to the collaborative environment on.

look

public abstract void look(java.lang.String at)
Send the look command to the collaborative environment.
Parameters:
at - the object in the collaborative environment to look at. This parameter may be null.

say

public abstract void say(java.lang.String what)
Send the say command to the collaborative environment.
Parameters:
what - to say.

yell

public abstract void yell(java.lang.String what)
Send the yell command to the collaborative environment.
Parameters:
what - to yell.

pose

public abstract void pose(java.lang.String what)
Send the pose command to the collaborative environment.
Parameters:
what - fake action to perform.

page

public abstract void page(java.lang.String who,
                          java.lang.String what)
Sends a page to a specific character in the collaborative environment.
Parameters:
who - to send the page to.
what - the message is. What may be null and the behaviour of the page may vary from collaborative environment to collaborative environment.

whisper

public abstract void whisper(java.lang.String who,
                             java.lang.String what)
Sends a whispered message to a specific character in the collaborative environment.
Parameters:
who - to send the whisper to.
what - the message is.

mutter

public abstract void mutter(java.lang.String who,
                            java.lang.String what)
Sends a muttered message to everyone except the character in the collaborative environment.
Parameters:
who - not to send the message to.
what - the message is.

emote

public abstract void emote(java.lang.String who,
                           java.lang.String what)
Sends an emote command to the collaborative environment. An emote is a cross between a page and a pose command and can be used to express actions to other players at a distance.
Parameters:
who - to send the emote to.
what - the emoted action is.

go

public abstract void go(java.lang.String where)
Send the go command to the collaborative environment. The go command is how characters navigate from room to room in the collaborative environment.
Parameters:
where - the direction to go.

goHome

public abstract void goHome()
A special case of the go command to send a player back to his or her default room in the collaborative environment. This command is usually implemented as a call to the go command in this class.

quit

public abstract void quit()
Sends the command to the collaborative environment to end the current session.

set

public abstract void set(java.lang.String what,
                         java.lang.String flag)
Sends the set command to the collaborative environment. The set command lets players change attributes of themselves and other objects in the collaborative environment.
Parameters:
what - to set.
flag - the value to set on the object.

inventory

public abstract void inventory()
Sends the inventory command to the collaborative environment. This command tells the collaborative environment to list the objects that the character is carrying.

setOutputPrefix

public abstract void setOutputPrefix(java.lang.String what)
Sends the OUTPUTPREFIX command to the collaborative environment. This command is used to tell the collaborative environment to send a particular string at the beginning of each command that is generated by the character.
Parameters:
what - the string to prefix the output of a command with.

setOutputSuffix

public abstract void setOutputSuffix(java.lang.String what)
Sends the OUTPUTSUFFIX command to the collaborative environment. This command is used to tell the collaborative environment to send a particular string at the end of each command that is generated by the character.
Parameters:
what - the string to suffix the output of a command with.

describe

public abstract void describe(java.lang.String description)
Sends the describe command to the collaborative environment. The describe command is used to set descriptions on players and objects in the collaborative environment.

getHowSays

public abstract java.lang.String getHowSays()
Deprecated.  


getHowPages

public abstract java.lang.String getHowPages()
Deprecated.  


getHowWhispers

public abstract java.lang.String getHowWhispers()
Deprecated.