Affectable
, Behavable
, CloseableLockable
, CMObject
, CMObjectWrapper
, Contingent
, DBIdentifiable
, Environmental
, Expireable
, Modifiable
, MsgListener
, Physical
, PhysicalAgent
, Readable
, Rider
, StatsAffecting
, Tickable
, Container
, Item
, Wearable
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
StdRideableWrapper
public class StdContainerWrapper extends StdItemWrapper implements Item, Container, CMObjectWrapper
Wearable.CODES
Modifier and Type | Field | Description |
---|---|---|
protected Container |
container |
idConverter
CONTAIN_ANYTHING, CONTAIN_BODIES, CONTAIN_CAGED, CONTAIN_CLOTHES, CONTAIN_COINS, CONTAIN_DAGGERS, CONTAIN_DESCS, CONTAIN_DRINKABLES, CONTAIN_EATABLES, CONTAIN_FOOTWEAR, CONTAIN_KEYS, CONTAIN_LIQUID, CONTAIN_ONEHANDWEAPONS, CONTAIN_OTHERWEAPONS, CONTAIN_RAWMATERIALS, CONTAIN_READABLES, CONTAIN_SCROLLS, CONTAIN_SHIELDS, CONTAIN_SMOKEABLES, CONTAIN_SSCOMPONENTS, CONTAIN_SWORDS
amDestroyed, basePhyStats, isSavable, item, myContainer, owner, riding
DEFAULT_WORN_CODES, DEFAULT_WORN_DEPENDENCYGRID, DEFAULT_WORN_DESCS, DEFAULT_WORN_ORDER, DEFAULT_WORN_USUAL_NAMES, DEFAULT_WORN_WEIGHT_POINTS, DEFAULT_WORN_WEIGHTS, FILTER_ANY, FILTER_MOBINVONLY, FILTER_ROOMONLY, FILTER_UNWORNONLY, FILTER_WORNONLY, HIGHEST_WORN_CODE, IN_INVENTORY, WORN_ABOUT_BODY, WORN_ARMS, WORN_BACK, 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_RIGHT_FINGER, WORN_RIGHT_WRIST, WORN_TORSO, WORN_WAIST, WORN_WIELD
Constructor | Description |
---|---|
StdContainerWrapper() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
canContain(Item I) |
Returns whether this container is allowed to contain the given object.
|
int |
capacity() |
Returns the maximum weight that can fit inside this container.
|
long |
containTypes() |
Returns a bitmap of the types of things that this container can hold.
|
boolean |
defaultsClosed() |
For exits with a door, this returns whether this
defaults in a closed state.
|
boolean |
defaultsLocked() |
For exits with a door and lock, this returns whether this
defaults in a closed and locked state.
|
void |
emptyPlease(boolean flatten) |
Empties this container into its owner.
|
ReadOnlyList<Item> |
getContents() |
Returns all the immediate items in this container, including
other containers, but not the contents of those innner containers.
|
ReadOnlyList<Item> |
getDeepContents() |
Returns all the items in this container, including other
containers and THEIR contents, recursively.
|
boolean |
hasADoor() |
Returns whether this has a door, and must be opened before
being used.
|
boolean |
hasALock() |
Returns whether this has a lock on it, and, if locked,
must be unlocked before being used.
|
boolean |
hasContent() |
Returns whether there is anything at all in this container.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
isInside(Item I) |
Returns whether the given item is, in fact, inside this container, even
recursively.
|
boolean |
isLocked() |
Returns whether this is LOCKED, and must be unlocked before
being used.
|
boolean |
isOpen() |
Returns whether this is OPEN and may be accessed or travelled through
|
java.lang.String |
keyName() |
For things with doors and locks, this returns the unique string
representing the key code required to unlock/lock it.
|
CMObject |
newInstance() |
Returns a new instance of this class.
|
int |
openDelayTicks() |
Returns the number of ticks that this remains open when a mob
or player changes it from a closed to an open state, and this thing
defaults in a closed state.
|
void |
setCapacity(int newValue) |
Sets the maximum weight that can fit inside this container.
|
void |
setContainTypes(long containTypes) |
Sets a bitmap of the types of things that this container can hold.
|
void |
setDoorsNLocks(boolean hasADoor,
boolean isOpen,
boolean defaultsClosed,
boolean hasALock,
boolean isLocked,
boolean defaultsLocked) |
Modifies the various door/lock settings for this thing.
|
void |
setKeyName(java.lang.String keyName) |
For things with doors and locks, this sets the unique string
representing the key code required to unlock/lock it.
|
void |
setOpenDelayTicks(int numTicks) |
Sets the number of ticks that this will remain open when a mob
or player changes it from a closed to an open state, and this thing
defaults in a closed state.
|
void |
setWrappedObject(CMObject obj) |
Set the object wrapped by this one.
|
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
copyOf, initializeClass
getWrappedObject
canSaveDatabaseID, databaseID, setDatabaseID
baseGoldValue, container, material, numberOfItems, owner, rawSecretIdentity, recursiveWeight, removeFromOwnerContainer, secretIdentity, setBaseValue, setContainer, setMaterial, setOwner, setSecretIdentity, setUsesRemaining, stopTicking, subjectToWearAndTear, ultimateContainer, usesRemaining, value
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isReadable, readableText, setReadable, setReadableText
addBehavior, addEffect, addNonUninvokableEffect, addScript, affectCharState, affectCharStats, affectPhyStats, amBeingWornProperly, amDestroyed, amWearingAt, baseGoldValue, basePhyStats, behaviors, canSaveDatabaseID, canWear, compareProperLocations, compareTo, container, copyOf, databaseID, delAllBehaviors, delAllEffects, delAllScripts, delBehavior, delEffect, delScript, description, description, destroy, displayText, displayText, eachBehavior, eachEffect, eachScript, effects, executeMsg, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, fitsOn, genericName, getSaveStatIndex, getStat, getStatCodes, getTickStatus, getWrappedObject, image, initializeClass, isGeneric, isReadable, isSavable, isStat, L, material, maxRange, minRange, miscTextFormat, name, name, Name, numBehaviors, numberOfItems, numEffects, numScripts, okMessage, owner, phyStats, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recoverPhyStats, recursiveWeight, removeFromOwnerContainer, riding, sameAs, scripts, secretIdentity, setBasePhyStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setMiscText, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadable, setReadableText, setRiding, setSavable, setSecretIdentity, setStat, setUsesRemaining, stopTicking, subjectToWearAndTear, text, tick, ultimateContainer, unWear, usesRemaining, value, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
amBeingWornProperly, amWearingAt, canWear, compareProperLocations, fitsOn, rawLogicalAnd, rawProperLocationBitmap, rawWornCode, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, unWear, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
protected Container container
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdItemWrapper
public void setWrappedObject(CMObject obj)
CMObjectWrapper
setWrappedObject
in interface CMObjectWrapper
setWrappedObject
in class StdItemWrapper
obj
- the object to wrappublic CMObject newInstance()
CMObject
newInstance
in interface CMObject
newInstance
in class StdItemWrapper
public boolean isOpen()
CloseableLockable
isOpen
in interface CloseableLockable
public boolean isLocked()
CloseableLockable
isLocked
in interface CloseableLockable
CloseableLockable.hasADoor()
,
CloseableLockable.hasALock()
public boolean hasADoor()
CloseableLockable
hasADoor
in interface CloseableLockable
CloseableLockable.isOpen()
,
CloseableLockable.isLocked()
public boolean hasALock()
CloseableLockable
hasALock
in interface CloseableLockable
CloseableLockable.isOpen()
,
CloseableLockable.isLocked()
,
CloseableLockable.hasADoor()
public boolean defaultsLocked()
CloseableLockable
defaultsLocked
in interface CloseableLockable
CloseableLockable.hasADoor()
,
CloseableLockable.defaultsClosed()
public boolean defaultsClosed()
CloseableLockable
defaultsClosed
in interface CloseableLockable
CloseableLockable.hasADoor()
,
CloseableLockable.defaultsLocked()
public void setDoorsNLocks(boolean hasADoor, boolean isOpen, boolean defaultsClosed, boolean hasALock, boolean isLocked, boolean defaultsLocked)
CloseableLockable
setDoorsNLocks
in interface CloseableLockable
hasADoor
- whether this has a doorisOpen
- whether this is open for usedefaultsClosed
- whether this defaults closedhasALock
- whether this has a lockisLocked
- whether this is presently lockeddefaultsLocked
- whether this defaults closed and locked.CloseableLockable.isOpen()
,
CloseableLockable.isLocked()
,
CloseableLockable.hasADoor()
,
CloseableLockable.hasALock()
,
CloseableLockable.defaultsClosed()
,
CloseableLockable.defaultsLocked()
public java.lang.String keyName()
CloseableLockable
keyName
in interface CloseableLockable
CloseableLockable.setKeyName(String)
public void setKeyName(java.lang.String keyName)
CloseableLockable
setKeyName
in interface CloseableLockable
keyName
- the new key codeCloseableLockable.keyName()
public int openDelayTicks()
CloseableLockable
openDelayTicks
in interface CloseableLockable
CloseableLockable.setOpenDelayTicks(int)
,
Tickable.TICKID_EXIT_REOPEN
public void setOpenDelayTicks(int numTicks)
CloseableLockable
setOpenDelayTicks
in interface CloseableLockable
numTicks
- the number of ticks this will remain openCloseableLockable.openDelayTicks()
,
Tickable.TICKID_EXIT_REOPEN
public ReadOnlyList<Item> getDeepContents()
Container
getDeepContents
in interface Container
Container.getContents()
public ReadOnlyList<Item> getContents()
Container
getContents
in interface Container
Container.getDeepContents()
public int capacity()
Container
capacity
in interface Container
Container.setCapacity(int)
public void setCapacity(int newValue)
Container
setCapacity
in interface Container
newValue
- the maximum weight that can fit inside this containerContainer.capacity()
public boolean hasContent()
Container
hasContent
in interface Container
public boolean canContain(Item I)
Container
canContain
in interface Container
I
- the item to check against the allowed contentContainer.setContainTypes(long)
,
Container.containTypes()
public boolean isInside(Item I)
Container
public long containTypes()
Container
containTypes
in interface Container
Container.setContainTypes(long)
,
Container.CONTAIN_ANYTHING
,
Container.CONTAIN_DESCS
public void setContainTypes(long containTypes)
Container
setContainTypes
in interface Container
containTypes
- a bitmap of the types of things that this container can hold.Container.containTypes()
,
Container.CONTAIN_ANYTHING
,
Container.CONTAIN_DESCS
public void emptyPlease(boolean flatten)
Container
emptyPlease
in interface Container
flatten
- if true, will also remove all recursive items from their containers