com.planet_ink.coffee_mud.Items.interfaces
Interface Container

All Superinterfaces:
Affectable, Behavable, java.lang.Cloneable, CloseableLockable, CMObject, java.lang.Comparable<CMObject>, Contingent, DBIdentifiable, Environmental, Item, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, Rider, StatsAffecting, Tickable, Wearable
All Known Subinterfaces:
DeadBody, DeckOfCards, FuelConsumer, HandOfCards
All Known Implementing Classes:
Backpack, BagOfEndlessness, BagOfHolding, BandedArmor, Bed, Boat, ChainMailArmor, ChainMailVest, Chair, CloseableContainer, Corpse, Dress, DrowChainMailArmor, EternityBarkArmor, EternityLeafArmor, EternityLeafShield, FieldPlate, FullPlate, GenArmor, GenBagOfEndlessness, GenBed, GenBelt, GenBoat, GenCage, GenCageRideable, GenChair, GenCigar, GenClanCommonContainer, GenClanContainer, GenCloak, GenCompGenerator, GenComputerConsole, GenContainer, GenCorpse, GenDress, GenDrink, GenElecContainer, GenElecPanel, GenEmptyDrink, GenFountain, GenGrapples, GenLiquidResource, GenMobilePortal, GenMultiPotion, GenPants, GenPerfume, GenPiano, GenPipe, GenPortal, GenPotion, GenRideable, GenSailingShip, GenShield, GenShipEngine, GenShipPanel, GenShipThruster, GenShirt, GenShoes, GenSiegeWeapon, GenSpaceShip, GenTable, GenTriCorder, GenTub, GenWater, GlovesSpeed, GlowingMageArmor, GoodyBag, GreatHelm, Hat, Hat_Intelligence, Helmet, HerbChest, HideArmor, HoleInTheGround, Hood, HorseCart, Ingredients, LargeChest, LargeSack, LeatherArmor, LeatherBoots, LeatherBracers, LeatherCap, LeatherGauntlets, LifeFountain, LockableContainer, MetalBracers, MichaelsMithrilChain, NeedleChest, OilFlask, PaddedArmor, Pan, Pants, PortableHole, Pot, RingMail, Robes, ScaleMail, Shirt, Shoes, SmallChest, SmallSack, SplintMail, Spring, StdArmor, StdBoardable, StdCage, StdCageRideable, StdClanCommonContainer, StdClanContainer, StdCompFuelConsumer, StdCompGenerator, StdCompPanel, StdComputerConsole, StdContainer, StdDeckOfCards, StdDrink, StdElecCompContainer, StdElecContainer, StdElecPanel, StdGrapples, StdHandOfCards, StdPerfume, StdPortal, StdPotion, StdRideable, StdShield, StdShipEngine, StdShipThruster, StdSiegeWeapon, StdSmokable, StdTriCorder, StdTub, SteelGauntlets, StuddedLeatherArmor, ThreadbareRobes, TrappedChest, WalkingBoots, Waterskin, Wineskin

public interface Container
extends Item, CloseableLockable

A container is an item that contains other items, including other containers. Next to the Item interface, the Container interface is probably the most basic.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
Wearable.CODES
 
Field Summary
static int CONTAIN_ANYTHING
          Container type that overrides all others -- the container can hold anything!
static int CONTAIN_BODIES
          Container Type flag that means the container can hold corpses
static int CONTAIN_CAGED
          Container Type flag that means the container can hold caged animals
static int CONTAIN_CLOTHES
          Container Type flag that means the container can hold clothing
static int CONTAIN_COINS
          Container Type flag that means the container can hold coins
static int CONTAIN_DAGGERS
          Container Type flag that means the container can hold daggers
static java.lang.String[] CONTAIN_DESCS
          Ordinal list of the names of all the container bitmask types.
static int CONTAIN_DRINKABLES
          Container Type flag that means the container can hold drinkables
static int CONTAIN_EATABLES
          Container Type flag that means the container can hold foods
static int CONTAIN_FOOTWEAR
          Container Type flag that means the container can hold shoes
static int CONTAIN_KEYS
          Container Type flag that means the container can hold keys
static int CONTAIN_LIQUID
          Container Type flag that means the container can hold liquids
static int CONTAIN_ONEHANDWEAPONS
          Container Type flag that means the container can hold one handed weapons
static int CONTAIN_OTHERWEAPONS
          Container Type flag that means the container can hold other weapons
static int CONTAIN_RAWMATERIALS
          Container Type flag that means the container can hold raw resources
static int CONTAIN_READABLES
          Container Type flag that means the container can hold books and such
static int CONTAIN_SCROLLS
          Container Type flag that means the container can hold scrolls
static int CONTAIN_SMOKEABLES
          Container Type flag that means the container can hold smokeables
static int CONTAIN_SSCOMPONENTS
          Container Type flag that means the container can hold space ship components
static int CONTAIN_SWORDS
          Container Type flag that means the container can hold swords
 
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_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
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
 
Method Summary
 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.
 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 hasContent()
          Returns whether there is anything at all in this container.
 boolean isInside(Item I)
          Returns whether the given item is, in fact, inside this container, even recursively.
 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.
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
baseGoldValue, container, material, numberOfItems, owner, rawSecretIdentity, recursiveWeight, removeFromOwnerContainer, secretIdentity, setBaseValue, setContainer, setMaterial, setOwner, setSecretIdentity, setUsesRemaining, stopTicking, subjectToWearAndTear, ultimateContainer, usesRemaining, value
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Physical
description, displayText, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, L, maxRange, minRange, miscTextFormat, Name, rawImage, sameAs, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
executeMsg, okMessage
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Contingent
amDestroyed, destroy, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, basePhyStats, delAllEffects, delEffect, eachEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.DBIdentifiable
canSaveDatabaseID, databaseID, setDatabaseID
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
amBeingWornProperly, amWearingAt, canWear, compareProperLocations, fitsOn, rawLogicalAnd, rawProperLocationBitmap, rawWornCode, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, unWear, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Readable
isReadable, readableText, setReadable, setReadableText
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CloseableLockable
defaultsClosed, defaultsLocked, hasADoor, hasALock, isLocked, isOpen, keyName, openDelayTicks, setDoorsNLocks, setKeyName, setOpenDelayTicks
 

Field Detail

CONTAIN_ANYTHING

static final int CONTAIN_ANYTHING
Container type that overrides all others -- the container can hold anything!

See Also:
setContainTypes(long), containTypes(), Constant Field Values

CONTAIN_LIQUID

static final int CONTAIN_LIQUID
Container Type flag that means the container can hold liquids

See Also:
Constant Field Values

CONTAIN_COINS

static final int CONTAIN_COINS
Container Type flag that means the container can hold coins

See Also:
Constant Field Values

CONTAIN_SWORDS

static final int CONTAIN_SWORDS
Container Type flag that means the container can hold swords

See Also:
Constant Field Values

CONTAIN_DAGGERS

static final int CONTAIN_DAGGERS
Container Type flag that means the container can hold daggers

See Also:
Constant Field Values

CONTAIN_OTHERWEAPONS

static final int CONTAIN_OTHERWEAPONS
Container Type flag that means the container can hold other weapons

See Also:
Constant Field Values

CONTAIN_ONEHANDWEAPONS

static final int CONTAIN_ONEHANDWEAPONS
Container Type flag that means the container can hold one handed weapons

See Also:
Constant Field Values

CONTAIN_BODIES

static final int CONTAIN_BODIES
Container Type flag that means the container can hold corpses

See Also:
Constant Field Values

CONTAIN_READABLES

static final int CONTAIN_READABLES
Container Type flag that means the container can hold books and such

See Also:
Constant Field Values

CONTAIN_SCROLLS

static final int CONTAIN_SCROLLS
Container Type flag that means the container can hold scrolls

See Also:
Constant Field Values

CONTAIN_CAGED

static final int CONTAIN_CAGED
Container Type flag that means the container can hold caged animals

See Also:
Constant Field Values

CONTAIN_KEYS

static final int CONTAIN_KEYS
Container Type flag that means the container can hold keys

See Also:
Constant Field Values

CONTAIN_DRINKABLES

static final int CONTAIN_DRINKABLES
Container Type flag that means the container can hold drinkables

See Also:
Constant Field Values

CONTAIN_CLOTHES

static final int CONTAIN_CLOTHES
Container Type flag that means the container can hold clothing

See Also:
Constant Field Values

CONTAIN_SMOKEABLES

static final int CONTAIN_SMOKEABLES
Container Type flag that means the container can hold smokeables

See Also:
Constant Field Values

CONTAIN_SSCOMPONENTS

static final int CONTAIN_SSCOMPONENTS
Container Type flag that means the container can hold space ship components

See Also:
Constant Field Values

CONTAIN_FOOTWEAR

static final int CONTAIN_FOOTWEAR
Container Type flag that means the container can hold shoes

See Also:
Constant Field Values

CONTAIN_RAWMATERIALS

static final int CONTAIN_RAWMATERIALS
Container Type flag that means the container can hold raw resources

See Also:
Constant Field Values

CONTAIN_EATABLES

static final int CONTAIN_EATABLES
Container Type flag that means the container can hold foods

See Also:
Constant Field Values

CONTAIN_DESCS

static final java.lang.String[] CONTAIN_DESCS
Ordinal list of the names of all the container bitmask types.

See Also:
setContainTypes(long), containTypes()
Method Detail

getDeepContents

ReadOnlyList<Item> getDeepContents()
Returns all the items in this container, including other containers and THEIR contents, recursively.

Returns:
all the items in this container, recursively
See Also:
getContents()

getContents

ReadOnlyList<Item> getContents()
Returns all the immediate items in this container, including other containers, but not the contents of those innner containers. Just the first level contents of this container.

Returns:
all the immediate items in this container
See Also:
getDeepContents()

capacity

int capacity()
Returns the maximum weight that can fit inside this container. Weight is used as a proxy for volume in CoffeeMud.

Returns:
the maximum weight that can fit inside this container
See Also:
setCapacity(int)

setCapacity

void setCapacity(int newValue)
Sets the maximum weight that can fit inside this container. Weight is used as a proxy for volume in CoffeeMud.

Parameters:
newValue - the maximum weight that can fit inside this container
See Also:
capacity()

hasContent

boolean hasContent()
Returns whether there is anything at all in this container.

Returns:
true if there is anything in this container, false if it is empty

canContain

boolean canContain(Item I)
Returns whether this container is allowed to contain the given object.

Parameters:
I - the item to check against the allowed content
Returns:
true if the given item can go in this container, false otherwise
See Also:
setContainTypes(long), containTypes()

isInside

boolean isInside(Item I)
Returns whether the given item is, in fact, inside this container, even recursively. So if the given item is in a container, and that container is in THIS container, it would still be inside.

Parameters:
I - the item to check against the content
Returns:
true if the item is somewhere inside, false otherwise

containTypes

long containTypes()
Returns a bitmap of the types of things that this container can hold.

Returns:
a bitmap of the types of things that this container can hold
See Also:
setContainTypes(long), CONTAIN_ANYTHING, CONTAIN_DESCS

setContainTypes

void setContainTypes(long containTypes)
Sets a bitmap of the types of things that this container can hold.

Parameters:
containTypes - a bitmap of the types of things that this container can hold.
See Also:
containTypes(), CONTAIN_ANYTHING, CONTAIN_DESCS

emptyPlease

void emptyPlease(boolean flatten)
Empties this container into its owner.

Parameters:
flatten - if true, will also remove all recursive items from their containers