|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcmd.Alias
public class Alias
Alias Creates a new alias. An alias is just another for the user to type a command. For example, "e" instead of "move e".
Constructor Summary | |
---|---|
Alias()
|
Method Summary | |
---|---|
void |
addParams(java.lang.String[] newParams)
Add an array of parameters to the current parameter list |
void |
construct(java.lang.String[] params)
construct is called when the Command is created. |
void |
exec(Player p)
exec is the main method of the command. |
static boolean |
exists(java.lang.String name)
Checks to see if an alias exists with selected name |
static Alias |
get(java.lang.String name)
Get specified alias |
java.lang.String |
getCommand()
Get the command that is tied to this alias |
java.lang.String[] |
getParams()
Casts the list of params into an array |
void |
remove()
Removes current alias |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Alias()
Method Detail |
---|
public void exec(Player p)
Command
exec
in interface Command
p
- is the main player. The player is passed to exec because
a lot of useful info, such as the current room, are attached to the
Player class.public void construct(java.lang.String[] params)
Command
construct
in interface Command
public static Alias get(java.lang.String name)
name
-
public java.lang.String[] getParams()
public java.lang.String getCommand()
public void remove()
public void addParams(java.lang.String[] newParams)
newParams
- New array of parameters to add to the aliaspublic static boolean exists(java.lang.String name)
name
- alias name to check for
public java.lang.String toString()
toString
in interface Command
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |