com.planet_ink.coffee_mud.core.interfaces
Interface ItemPossessor

All Superinterfaces:
Affectable, Behavable, java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, StatsAffecting, Tickable
All Known Subinterfaces:
Deity, GridLocale, MOB, Room
All Known Implementing Classes:
AngryCitizen, Ape, Assassin, Bee, BlackBear, BlackDragon, BlueDragon, BrassDragon, BronzeDragon, BrownBear, Buck, Buffalo, Bugbear, Bull, Cat, CaveGrid, CaveMaze, CaveRoom, CaveSurface, Centaur, Cheetah, Chicken, Chimp, Citizen, CityStreet, ClimbableLedge, ClimbableSurface, Cobra, CommonBat, CopperDragon, Cow, Deer, Desert, DesertGrid, DesertMaze, DesertThinGrid, Doe, Dog, Doppleganger, Dragon, DrowElf, DrowPriestess, DrowWarrior, DrowWizard, Duck, EndlessOcean, EndlessSky, EndlessThinOcean, EndlessThinSky, Falcon, FireGiant, Fox, FrozenMountains, FrozenPlains, GardenSnake, GenAuctioneer, GenBanker, GenDeity, GenMob, GenPostman, GenRideable, GenShopkeeper, GenUndead, GiantBat, GiantScorpion, Gnoll, Goblin, GoldDragon, Gorilla, GreatLake, GreatThinLake, GreenDragon, HeavenlyServent, HillGiant, Hills, HillsGrid, HillsThinGrid, Horse, HotRoom, IceRoom, IndoorInTheAir, IndoorShallowWater, IndoorUnderWater, IndoorWaterSurface, InTheAir, InvisibleStalker, Jaguar, Jungle, JungleGrid, JungleThinGrid, Kitten, LargeBat, LargeCaveRoom, LargeStoneRoom, LargeWoodRoom, Lion, Lizard, LizardMan, LizardManShaman, MagicFreeRoom, MagicShelter, MetalRoom, Minotaur, Monkey, Mountains, MountainsGrid, MountainsMaze, MountainsThinGrid, MountainSurface, MountainSurfaceGrid, MountainSurfaceThinGrid, Mouse, Ogre, Orc, OverTheLedge, Panther, Parakeet, Pegasus, PegasusGreater, Pig, Plains, PlainsGrid, PlainsThinGrid, Puppy, Python, Rabbit, Rat, Rattlesnake, Raven, RedDragon, Road, RoadGrid, RoadThinGrid, SaltWaterSurface, SaltWaterThinSurface, SewerMaze, SewerRoom, ShallowWater, Sheep, Shore, SilverDragon, Skeleton, SpacePort, StdAuctioneer, StdBanker, StdDeity, StdGrid, StdMaze, StdMOB, StdPostman, StdRideable, StdRoom, StdShopKeeper, StdThinGrid, StoneGiant, StoneGolem, StoneGrid, StoneMaze, StoneRoom, StoneThinGrid, Swamp, SwampGrid, SwampThinGrid, Teacher, ThinRoom, Tiger, TreeSurface, Troll, Turtle, UmberHulk, Undead, UnderSaltWater, UnderSaltWaterGrid, UnderSaltWaterMaze, UnderSaltWaterThinGrid, UnderWater, UnderWaterGrid, UnderWaterMaze, UnderWaterThinGrid, WaterSurface, WaterThinSurface, WetCaveGrid, WetCaveMaze, WetCaveRoom, WhiteDragon, WildEagle, Wolf, WoodRoom, WoodRoomGrid, WoodRoomMaze, WoodRoomThinGrid, Woods, WoodsGrid, WoodsMaze, WoodsThinGrid, Wyvern, Zombie

public interface ItemPossessor
extends PhysicalAgent

An interface for something capable of possessing Items


Nested Class Summary
static class ItemPossessor.Expire
          constants for the addItem methods to denote how long the item lives before expiring
static class ItemPossessor.Find
          constant for the findItem/findItems method denoting special modifying flags on the search
static class ItemPossessor.Move
          constant for the moveItemTo methods to denote flags are being given -- normal operation
 
Field Summary
 
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
 
Method Summary
 void addItem(Item item)
          Adds a new item to its possessor.
 void addItem(Item item, ItemPossessor.Expire expire)
          Adds a new item to its possessor, with an expiration code.
 void delItem(Item item)
          Removes the item from this possessor.
 Item findItem(Item goodLocation, java.lang.String itemID)
          Returns the item in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found).
 Item findItem(java.lang.String itemID)
          Returns the item in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found).
 java.util.List<Item> findItems(Item goodLocation, java.lang.String itemID)
          Returns all items in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).
 java.util.List<Item> findItems(java.lang.String itemID)
          Returns all items in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).
 Item getItem(int i)
          Returns the item at the given index, regardless of container status, visibility, or other modifiers.
 boolean isContent(Item item)
          Returns whether the given item is in this possessors list.
 java.util.Enumeration<Item> items()
          An enumeration of all the items at this possessor.
 void moveItemTo(Item container)
          Intelligently removes an item from its current location and moves it to this possessor, managing any container contents.
 void moveItemTo(Item container, ItemPossessor.Expire expire, ItemPossessor.Move... moveFlags)
          Intelligently removes an item from its current location and moves it to this possessor, managing any container contents, and possibly followers/riders if the item is a cart.
 int numItems()
          Returns the total number of items at this possessor, regardless of container status.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, maxRange, minRange, miscTextFormat, name, Name, rawImage, sameAs, 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.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, delEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delBehavior, delScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 

Method Detail

addItem

void addItem(Item item)
Adds a new item to its possessor. By default, the item is added in a default resting state -- no containers, timeouts, or other modifiers are set. Duplicates will not be permitted.

Parameters:
item - the item to add
See Also:
delItem(Item)

addItem

void addItem(Item item,
             ItemPossessor.Expire expire)
Adds a new item to its possessor, with an expiration code. Duplicates will not be permitted.

Parameters:
item - the item to add
See Also:
ItemPossessor.Expire

moveItemTo

void moveItemTo(Item container,
                ItemPossessor.Expire expire,
                ItemPossessor.Move... moveFlags)
Intelligently removes an item from its current location and moves it to this possessor, managing any container contents, and possibly followers/riders if the item is a cart. An expiration can be set on the move to have the items expire. Duplicates will not be permitted.

Parameters:
container - the item to add
expire - the expiration code
moveFlags - any flags related to the move
See Also:
ItemPossessor.Expire

moveItemTo

void moveItemTo(Item container)
Intelligently removes an item from its current location and moves it to this possessor, managing any container contents. Is the same as calling the longer moveItemTo with a Never expiration, and NO movement flags. Duplicates will not be permitted.

Parameters:
container - the item to add
See Also:
ItemPossessor.Expire

delItem

void delItem(Item item)
Removes the item from this possessor.

Parameters:
item - the item to remove

numItems

int numItems()
Returns the total number of items at this possessor, regardless of container status.

Returns:
the total number of items

getItem

Item getItem(int i)
Returns the item at the given index, regardless of container status, visibility, or other modifiers.

Parameters:
i - the index of the item
Returns:
the item at that index, or null if its not found

items

java.util.Enumeration<Item> items()
An enumeration of all the items at this possessor.

Returns:
enumeration of all the items at this possessor.

findItem

Item findItem(Item goodLocation,
              java.lang.String itemID)
Returns the item in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found). Handles indexing for duplicate-named items.

Parameters:
goodLocation - the container to look in, or null for none
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

findItem

Item findItem(java.lang.String itemID)
Returns the item in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found). Handles indexing for duplicate-named items.

Parameters:
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

findItems

java.util.List<Item> findItems(Item goodLocation,
                               java.lang.String itemID)
Returns all items in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).

Parameters:
goodLocation - the container to look in, or null for none
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

findItems

java.util.List<Item> findItems(java.lang.String itemID)
Returns all items in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).

Parameters:
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

isContent

boolean isContent(Item item)
Returns whether the given item is in this possessors list.

Parameters:
item - the item to check
Returns:
true if the item was found, and false otherwise