com.planet_ink.coffee_mud.Items.Basic
Class StdRideable

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
      extended by com.planet_ink.coffee_mud.Items.Basic.StdContainer
          extended by com.planet_ink.coffee_mud.Items.Basic.StdRideable
All Implemented Interfaces:
Behavable, CMModifiable, CMObject, Environmental, MsgListener, Rideable, Rider, StatsAffecting, Tickable, Container, Item, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
Boat, Chair, GenRideable, StdCageRideable, StdShipConsole, StdTub

public class StdRideable
extends StdContainer
implements Rideable


Field Summary
protected  int rideBasis
           
protected  int riderCapacity
           
protected  java.util.Vector riders
           
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdContainer
capacity, containType, hasALid, hasALock, isLocked, isOpen
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
affects, baseEnvStats, baseGoldValue, behaviors, CODES, databaseID, description, destroyed, displayText, dispossessionTime, envStats, imageName, material, miscText, myContainer, myUses, myWornCode, name, owner, properWornBitmap, riding, scripts, secretIdentity, tickStatus, wornLogicalAnd, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rideable
RIDEABLE_AIR, RIDEABLE_DESCS, RIDEABLE_ENTERIN, RIDEABLE_LADDER, RIDEABLE_LAND, RIDEABLE_SIT, RIDEABLE_SLEEP, RIDEABLE_TABLE, RIDEABLE_WAGON, RIDEABLE_WATER
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MOB, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SPELL_AFFECT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET, TICKMASK_SOLITARY, TICKS_PER_RLMIN, TIME_MILIS_PER_MUDHOUR, TIME_TICK, TIME_TICK_DOUBLE
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Container
CONTAIN_ANYTHING, CONTAIN_BODIES, CONTAIN_CAGED, CONTAIN_CLOTHES, CONTAIN_COINS, CONTAIN_DAGGERS, CONTAIN_DESCS, CONTAIN_DRINKABLES, CONTAIN_FOOTWEAR, CONTAIN_KEYS, CONTAIN_LIQUID, CONTAIN_ONEHANDWEAPONS, CONTAIN_OTHERWEAPONS, CONTAIN_READABLES, CONTAIN_SCROLLS, CONTAIN_SMOKEABLES, CONTAIN_SSCOMPONENTS, CONTAIN_SWORDS
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
IN_INVENTORY, WORN_ABOUT_BODY, WORN_ARMS, WORN_BACK, WORN_CODES, WORN_DEPENDENCYGRID, WORN_DESCS, WORN_EARS, WORN_EYES, WORN_FEET, WORN_FLOATING_NEARBY, WORN_HANDS, WORN_HEAD, WORN_HELD, WORN_LEFT_FINGER, WORN_LEFT_WRIST, WORN_LEGS, WORN_MOUTH, WORN_NECK, WORN_ORDER, WORN_RIGHT_FINGER, WORN_RIGHT_WRIST, WORN_TORSO, WORN_WAIST, WORN_WEIGHT_POINTS, WORN_WEIGHTS, WORN_WIELD, WORNREQ_ANY, WORNREQ_UNWORNONLY, WORNREQ_WORNONLY
 
Constructor Summary
StdRideable()
           
 
Method Summary
 void addRider(Rider mob)
          Adds a new Rider to this Rideable.
 void affectEnvStats(Environmental affected, EnvStats affectableStats)
          This method is called by the recoverEnvStats() method on other Environmental objects.
 boolean amRiding(Rider mob)
          Returns whether Rider is currently mounted on this Rideable
protected  void cloneFix(Item E)
           
 void delRider(Rider mob)
          Removes a Rider from this Rideable.
 void destroy()
          Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java.
 java.lang.String dismountString(Rider R)
          Returns a string grammatically correct for the given rider when they are dismounting this Rideable
 java.lang.String displayText()
          Gets the raw string used to show what this object looks like in the room.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 Rider fetchRider(int which)
          Returns a particular Rider mounted on this Rideable.
 java.util.HashSet getRideBuddies(java.util.HashSet list)
          Adds all of the MOB Riders on this Rideable to the given HashSet and returns it
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isMobileRideBasis()
          Whether the type of rideable is mobile.
 boolean mobileRideBasis()
          Whether this Rideable moves when the Rider wants to move it.
 java.lang.String mountString(int commandType, Rider R)
          Returns a string grammatically correct for the given rider when they are mounting this Rideable
 int numRiders()
          Returns the number of riders currently mounted on this Rideable
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 java.lang.String putString(Rider R)
          Returns a string grammatically correct for the given rider when they are putting something on this Rideable
 void recoverEnvStats()
          This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method.
 int rideBasis()
          The type of rideable object this is.
 int riderCapacity()
          The number of Riders which may ride upon this Rideable
 boolean savable()
          Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container.
 void setRideBasis(int basis)
          Sets type of rideable object this is.
 void setRiderCapacity(int newCapacity)
          Sets the number of Riders which may ride upon this Rideable
 java.lang.String stateString(Rider R)
          Returns a string grammatically correct for the given rider when they are mounted on this Rideable
 java.lang.String stateStringSubject(Rider R)
          Returns a string grammatically correct for this Rideable when Riders are mounted
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdContainer
canContain, capacity, containTypes, emptyPlease, getContents, hasALid, hasALock, isLocked, isOpen, keyName, reallyGetContents, setCapacity, setContainTypes, setKeyName, setLidsNLocks, setMiscText, tick
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
abilityImbuesMagic, addBehavior, addEffect, addNonUninvokableEffect, addScript, affectCharState, affectCharStats, alreadyWornMsg, amDestroyed, amWearingAt, baseEnvStats, baseGoldValue, canWear, canWearComplete, cloneEffects, compareProperLocations, compareTo, container, copyOf, databaseID, delBehavior, delEffect, delScript, description, envStats, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, finalize, fitsOn, getCodeNum, getSaveStatIndex, getStat, getStatCodes, getTickStatus, image, initializeClass, isGeneric, isStat, material, maxRange, minRange, miscTextFormat, name, Name, newInstance, numBehaviors, numberOfItems, numEffects, numScripts, owner, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recursiveWeight, removeFromOwnerContainer, riding, sameAs, secretIdentity, setBaseEnvStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadableText, setRiding, setSecretIdentity, setStat, setUsesRemaining, stopTicking, subjectToWearAndTear, tackOns, text, ultimateContainer, unWear, usesRemaining, value, wearAt, wearEvenIfImpossible, wearIfPossible, whereCantWear
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
addEffect, addNonUninvokableEffect, amDestroyed, baseEnvStats, delEffect, description, envStats, expirationDate, fetchEffect, fetchEffect, image, isGeneric, maxRange, minRange, miscTextFormat, name, Name, numEffects, rawImage, sameAs, setBaseEnvStats, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMModifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, delBehavior, delScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
amWearingAt, baseGoldValue, canWear, compareProperLocations, container, databaseID, fitsOn, material, numberOfItems, owner, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recursiveWeight, removeFromOwnerContainer, secretIdentity, setBaseValue, setContainer, setDatabaseID, setMaterial, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadableText, setSecretIdentity, setUsesRemaining, stopTicking, subjectToWearAndTear, ultimateContainer, unWear, usesRemaining, value, wearAt, wearEvenIfImpossible, wearIfPossible, whereCantWear
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 

Field Detail

rideBasis

protected int rideBasis

riderCapacity

protected int riderCapacity

riders

protected java.util.Vector riders
Constructor Detail

StdRideable

public StdRideable()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdContainer
Returns:
the name of this class

destroy

public void destroy()
Description copied from interface: Environmental
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have their destroy() method called will also call the destroy() methods on all items and other objects listed as content, recursively.

Specified by:
destroy in interface Environmental
Overrides:
destroy in class StdItem

savable

public boolean savable()
Description copied from interface: Environmental
Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container. It always returns true except under unique circumstances.

Specified by:
savable in interface Environmental
Overrides:
savable in class StdItem
Returns:
true, usually.

isMobileRideBasis

public boolean isMobileRideBasis()
Description copied from interface: Rideable
Whether the type of rideable is mobile.

Specified by:
isMobileRideBasis in interface Rideable
Returns:
Whether this type of rideable is mobile
See Also:
Rideable

rideBasis

public int rideBasis()
Description copied from interface: Rideable
The type of rideable object this is.

Specified by:
rideBasis in interface Rideable
Returns:
the RIDEABLE_* constant describing how this is ridden
See Also:
Rideable

setRideBasis

public void setRideBasis(int basis)
Description copied from interface: Rideable
Sets type of rideable object this is.

Specified by:
setRideBasis in interface Rideable
Parameters:
basis - the RIDEABLE_* constant describing how this is ridden
See Also:
Rideable

riderCapacity

public int riderCapacity()
Description copied from interface: Rideable
The number of Riders which may ride upon this Rideable

Specified by:
riderCapacity in interface Rideable
Returns:
the maximum riders
See Also:
Rider

setRiderCapacity

public void setRiderCapacity(int newCapacity)
Description copied from interface: Rideable
Sets the number of Riders which may ride upon this Rideable

Specified by:
setRiderCapacity in interface Rideable
Parameters:
newCapacity - the maximum riders
See Also:
Rider

numRiders

public int numRiders()
Description copied from interface: Rideable
Returns the number of riders currently mounted on this Rideable

Specified by:
numRiders in interface Rideable
Returns:
the number of current Riders
See Also:
Rider

fetchRider

public Rider fetchRider(int which)
Description copied from interface: Rideable
Returns a particular Rider mounted on this Rideable. May return null in the case of a race condition

Specified by:
fetchRider in interface Rideable
Parameters:
which - which rider to detch
Returns:
the rider riding
See Also:
Rider, Rideable, Rideable.numRiders()

addRider

public void addRider(Rider mob)
Description copied from interface: Rideable
Adds a new Rider to this Rideable. Is called by Rider.setRiding(Rideable) Should also call Rider.setRiding(Rideable) without recursion

Specified by:
addRider in interface Rideable
Parameters:
mob - Rider object, either an item or a mob
See Also:
Rider, Rideable

delRider

public void delRider(Rider mob)
Description copied from interface: Rideable
Removes a Rider from this Rideable. Is called by Rider.setRiding(null) Should also call Rider.setRiding(null) without recursion

Specified by:
delRider in interface Rideable
Parameters:
mob - Rider object, either an item or a mob
See Also:
Rider, Rideable

cloneFix

protected void cloneFix(Item E)
Overrides:
cloneFix in class StdItem

getRideBuddies

public java.util.HashSet getRideBuddies(java.util.HashSet list)
Description copied from interface: Rideable
Adds all of the MOB Riders on this Rideable to the given HashSet and returns it

Specified by:
getRideBuddies in interface Rideable
Parameters:
list - the hashset into which to add all the mob riders
Returns:
the same list passed in, filled

mobileRideBasis

public boolean mobileRideBasis()
Description copied from interface: Rideable
Whether this Rideable moves when the Rider wants to move it. Largely derived from rideBasis().

Specified by:
mobileRideBasis in interface Rideable
Returns:
whether this item moves with the rider
See Also:
Rideable.rideBasis()

stateString

public java.lang.String stateString(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are mounted on this Rideable

Specified by:
stateString in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of riding this Rideable
See Also:
Rider, Rideable

putString

public java.lang.String putString(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are putting something on this Rideable

Specified by:
putString in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of putting something on this Rideable
See Also:
Rider, Rideable

mountString

public java.lang.String mountString(int commandType,
                                    Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are mounting this Rideable

Specified by:
mountString in interface Rideable
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of mounting this Rideable
See Also:
Rider, Rideable

dismountString

public java.lang.String dismountString(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are dismounting this Rideable

Specified by:
dismountString in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of dismounting this Rideable
See Also:
Rider, Rideable

stateStringSubject

public java.lang.String stateStringSubject(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for this Rideable when Riders are mounted

Specified by:
stateStringSubject in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the Riderable state of being ridden
See Also:
Rider, Rideable

recoverEnvStats

public void recoverEnvStats()
Description copied from interface: Environmental
This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method. Surrounding objects include the room where the object is located, the Ability objects in the Effects list, the Behaviors in the behaviors list, and race/charclass/area if applicable. Those methods will then make all necessary adjustments to the values in the new envStats() object. When it returns, envStats() will have a totally updated object. This method must be called in code whenever the object is placed on the map, or when anything changes in its environment, such as location, effects, or other states.

Specified by:
recoverEnvStats in interface Environmental
Overrides:
recoverEnvStats in class StdItem
See Also:
Environmental.baseEnvStats(), Environmental.envStats(), Environmental.addEffect(Ability), Behavable.addBehavior(Behavior), EnvStats

affectEnvStats

public void affectEnvStats(Environmental affected,
                           EnvStats affectableStats)
Description copied from interface: StatsAffecting
This method is called by the recoverEnvStats() method on other Environmental objects. It is used to transform the Environmental baseEnvStats() object into a finished envStats() object, both of which are objects implementing the EnvStats interface. See those methods for more information.

Specified by:
affectEnvStats in interface StatsAffecting
Overrides:
affectEnvStats in class StdItem
Parameters:
affected - the host of the EnvStats object being affected
affectableStats - the particular EnvStats object being affected
See Also:
EnvStats, Environmental, Environmental.baseEnvStats(), Environmental.envStats(), Environmental.recoverEnvStats()

displayText

public java.lang.String displayText()
Description copied from interface: Environmental
Gets the raw string used to show what this object looks like in the room. May be used as a basis for other methods, such as the title of rooms, and what an exit looks like when open. The value for Items may be null if the item is not displayed when the room is seen.

Specified by:
displayText in interface Environmental
Overrides:
displayText in class StdItem
Returns:
the string describing how this object looks in the room

amRiding

public boolean amRiding(Rider mob)
Description copied from interface: Rideable
Returns whether Rider is currently mounted on this Rideable

Specified by:
amRiding in interface Rideable
Parameters:
mob - the Rider to check this Rideable for
Returns:
true if the Rider is mounted on this Rideable
See Also:
Rider, Rideable

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Overrides:
okMessage in class StdContainer
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdContainer
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg