mstar
Class MudPlayer

java.lang.Object
  |
  +--mstar.MudObject
        |
        +--mstar.MudPlayer

public class MudPlayer
extends MudObject

A class that represents a player in the collaborative environment and information about that player including: name, description, an inventory of the objects that the character is carrying, and the titles and memberships that the character has earned or been granted. In addition there are methods for creating psuedo-MAAS-Neotek representations of the character that can be written to map files on disk, and methods for adding titles and objects.

Version:
1.6
Author:
Thaddeus O. Cooper (cooper@tweenproject.org)
See Also:
Serialized Form

Constructor Summary
MudPlayer()
          Create a player.
 
Method Summary
 void addObject(java.lang.String o)
          Adds an object to the list of objects that the character is carrying.
 void addTitle(java.lang.String t)
          Add a title to this player.
 java.lang.String[] getCarrying()
          Gets the list of objects that the character is carrying.
 java.lang.String[] getTitlesAndMemberships()
          Gets the String array that contains this characters titles and memberships.
 void setCarrying(java.lang.String[] objects)
          Sets the list of objects that the character is carrying.
 void setTitlesAndMemberships(java.lang.String[] titlesAndMemberships)
          Sets the String array that contains this characters titles and memberships.
 java.lang.String toMap()
          Creates a String representation of the character in psuedo-MAAS-Neotek format suitable for writing to disk.
 
Methods inherited from class mstar.MudObject
equals, getDBReference, getDescription, getFirstEncounter, getId, getLastEncounter, getName, setDBReference, setDescription, setFirstEncounter, setId, setLastEncounter, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MudPlayer

public MudPlayer()
Create a player.
Method Detail

setTitlesAndMemberships

public void setTitlesAndMemberships(java.lang.String[] titlesAndMemberships)
Sets the String array that contains this characters titles and memberships.
Parameters:
titlesAndMemberships - a String array containing each of the titles and memberships for this character.

getTitlesAndMemberships

public java.lang.String[] getTitlesAndMemberships()
Gets the String array that contains this characters titles and memberships.
Returns:
a String array containing each of the titles and memberships for this character.

addTitle

public void addTitle(java.lang.String t)
Add a title to this player.
Parameters:
t - the title to add.

setCarrying

public void setCarrying(java.lang.String[] objects)
Sets the list of objects that the character is carrying.
Parameters:
objects - a String array that represents the objects that the character is carrying.

getCarrying

public java.lang.String[] getCarrying()
Gets the list of objects that the character is carrying.
Returns:
a String array that represents the objects that the character is carrying.

addObject

public void addObject(java.lang.String o)
Adds an object to the list of objects that the character is carrying. If the current list of objects is null, then a new list is created before adding the object.
Parameters:
o - the object to be added to the list of objects that the the character is carrying.

toMap

public java.lang.String toMap()
Creates a String representation of the character in psuedo-MAAS-Neotek format suitable for writing to disk.
Overrides:
toMap in class MudObject
Returns:
a String representation of the character in pseudo-MAAS-Neotek for suitable for writing to disk.