com.planet_ink.coffee_mud.Items.Basic
Class GenResource

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
      extended by com.planet_ink.coffee_mud.Items.Basic.GenItem
          extended by com.planet_ink.coffee_mud.Items.Basic.GenResource
All Implemented Interfaces:
Affectable, Behavable, CMObject, Contingent, DBIdentifiable, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, Rider, StatsAffecting, Tickable, Item, RawMaterial, Wearable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class GenResource
extends GenItem
implements RawMaterial


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.RawMaterial
RawMaterial.CODES, RawMaterial.DefResource, RawMaterial.Material, RawMaterial.ResourceFlag, RawMaterial.ResourceSubType
 
Field Summary
protected  java.lang.String domainSource
           
protected  java.lang.String resourceSubType
           
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.GenItem
readableText
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
affectPhyStats, affects, baseGoldValue, basePhyStats, behaviors, cachedImageName, CODES, databaseID, description, destroyed, displayText, dispossessionTime, material, me, miscText, myContainer, myUses, myWornCode, name, owner, phyStats, properWornBitmap, rawImageName, riding, scripts, secretIdentity, tickCtr, tickStatus, wornLogicalAnd, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.RawMaterial
MATERIAL_CLOTH, MATERIAL_ENERGY, MATERIAL_FLESH, MATERIAL_GAS, MATERIAL_GLASS, MATERIAL_LEATHER, MATERIAL_LIQUID, MATERIAL_MASK, MATERIAL_METAL, MATERIAL_MITHRIL, MATERIAL_PAPER, MATERIAL_PRECIOUS, MATERIAL_ROCK, MATERIAL_SYNTHETIC, MATERIAL_UNKNOWN, MATERIAL_VEGETATION, MATERIAL_WOODEN, RESOURCE_ADAMANTITE, RESOURCE_AGATE, RESOURCE_AIR, RESOURCE_ALABASTER, RESOURCE_ALEXANDRITE, RESOURCE_ALUMINUM, RESOURCE_AMBER, RESOURCE_AMETHYST, RESOURCE_ANTIMATTER, RESOURCE_APPLES, RESOURCE_AQUAMARINE, RESOURCE_ASH, RESOURCE_ATLANTITE, RESOURCE_BALSA, RESOURCE_BAMBOO, RESOURCE_BANANAS, RESOURCE_BARLEY, RESOURCE_BASALT, RESOURCE_BEANS, RESOURCE_BEECHWOOD, RESOURCE_BEEF, RESOURCE_BERRIES, RESOURCE_BLACKBERRIES, RESOURCE_BLOOD, RESOURCE_BLOODSTONE, RESOURCE_BLUEBERRIES, RESOURCE_BONE, RESOURCE_BOYSENBERRIES, RESOURCE_BRASS, RESOURCE_BREAD, RESOURCE_BRONZE, RESOURCE_CACTUS, RESOURCE_CARP, RESOURCE_CARROTS, RESOURCE_CATFISH, RESOURCE_CEDAR, RESOURCE_CHEESE, RESOURCE_CHERRIES, RESOURCE_CHERRYWOOD, RESOURCE_CHINA, RESOURCE_CHLORINE, RESOURCE_CHROMIUM, RESOURCE_CHRYSOBERYL, RESOURCE_CITRINE, RESOURCE_CLAY, RESOURCE_COAL, RESOURCE_COCOA, RESOURCE_COCONUTS, RESOURCE_COFFEE, RESOURCE_COFFEEBEANS, RESOURCE_COPPER, RESOURCE_CORN, RESOURCE_COTTON, RESOURCE_CRACKER, RESOURCE_CRANBERRIES, RESOURCE_CRYSTAL, RESOURCE_DATES, RESOURCE_DENIM, RESOURCE_DEUTERIUM, RESOURCE_DIAMELS, RESOURCE_DIAMOND, RESOURCE_DIESEL, RESOURCE_DILITHIUM, RESOURCE_DIRT, RESOURCE_DRAGONBLOOD, RESOURCE_DRAGONMEAT, RESOURCE_DRAGONSCALES, RESOURCE_DRINKABLE, RESOURCE_DURANIUM, RESOURCE_DUST, RESOURCE_EBONY, RESOURCE_EGGS, RESOURCE_ELECTRICITY, RESOURCE_ELM, RESOURCE_EMERALD, RESOURCE_ENERGY, RESOURCE_FEATHERS, RESOURCE_FIBREGLASS, RESOURCE_FISH, RESOURCE_FLINT, RESOURCE_FLOURINE, RESOURCE_FLOWERS, RESOURCE_FRESHWATER, RESOURCE_FRUIT, RESOURCE_FUNGUS, RESOURCE_FUR, RESOURCE_GARLIC, RESOURCE_GARNET, RESOURCE_GASOLINE, RESOURCE_GEM, RESOURCE_GLASS, RESOURCE_GOLD, RESOURCE_GRANITE, RESOURCE_GRAPES, RESOURCE_GREENS, RESOURCE_HEMP, RESOURCE_HERBS, RESOURCE_HICKORY, RESOURCE_HIDE, RESOURCE_HONEY, RESOURCE_HOPS, RESOURCE_HYDROGEN, RESOURCE_IRON, RESOURCE_IRONWOOD, RESOURCE_IVORY, RESOURCE_JADE, RESOURCE_LAMPOIL, RESOURCE_LAPIS, RESOURCE_LEAD, RESOURCE_LEATHER, RESOURCE_LEMONS, RESOURCE_LIMES, RESOURCE_LIMESTONE, RESOURCE_LIQUOR, RESOURCE_MAPLE, RESOURCE_MARBLE, RESOURCE_MASK, RESOURCE_MEAT, RESOURCE_MESQUITE, RESOURCE_MILK, RESOURCE_MITHRIL, RESOURCE_MOONSTONE, RESOURCE_MUSHROOMS, RESOURCE_MUTTON, RESOURCE_NITROGEN, RESOURCE_NOTHING, RESOURCE_NUTS, RESOURCE_OAK, RESOURCE_OBSIDIAN, RESOURCE_OLIVES, RESOURCE_ONIONS, RESOURCE_ONYX, RESOURCE_OPAL, RESOURCE_ORANGES, RESOURCE_OXYGEN, RESOURCE_PAPER, RESOURCE_PEACHES, RESOURCE_PEARL, RESOURCE_PEPPERS, RESOURCE_PERFUME, RESOURCE_PERIDOT, RESOURCE_PETROLEUM, RESOURCE_PINE, RESOURCE_PINEAPPLES, RESOURCE_PIPEWEED, RESOURCE_PLASMA, RESOURCE_PLASTIC, RESOURCE_PLATINUM, RESOURCE_PLUMS, RESOURCE_POISON, RESOURCE_POLYESTER, RESOURCE_PORK, RESOURCE_POTATOES, RESOURCE_POULTRY, RESOURCE_PUMICE, RESOURCE_QUARTZ, RESOURCE_RASPBERRIES, RESOURCE_REDWOOD, RESOURCE_REED, RESOURCE_RICE, RESOURCE_RUBBER, RESOURCE_RUBY, RESOURCE_SALMON, RESOURCE_SALT, RESOURCE_SALTWATER, RESOURCE_SAND, RESOURCE_SANDSTONE, RESOURCE_SAP, RESOURCE_SAPPHIRE, RESOURCE_SCALES, RESOURCE_SEAWEED, RESOURCE_SHALE, RESOURCE_SHRIMP, RESOURCE_SILICON, RESOURCE_SILK, RESOURCE_SILVER, RESOURCE_SLIME, RESOURCE_SMURFBERRIES, RESOURCE_SOAP, RESOURCE_SOAPSTONE, RESOURCE_SPICE, RESOURCE_SPIDERSTEEL, RESOURCE_SPRUCE, RESOURCE_STEEL, RESOURCE_STONE, RESOURCE_STRAWBERRIES, RESOURCE_SUGAR, RESOURCE_SYCAMORE, RESOURCE_TAR, RESOURCE_TEAK, RESOURCE_TIN, RESOURCE_TITANIUM, RESOURCE_TOMATOES, RESOURCE_TOPAZ, RESOURCE_TROUT, RESOURCE_TUNA, RESOURCE_TURQUOISE, RESOURCE_ULTRANIUM, RESOURCE_URANIUM, RESOURCE_VINE, RESOURCE_WAX, RESOURCE_WHEAT, RESOURCE_WHITE_GOLD, RESOURCE_WILLOW, RESOURCE_WOOD, RESOURCE_WOOL, RESOURCE_YEW, RESOURCE_ZINC
 
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
 
Constructor Summary
GenResource()
           
 
Method Summary
 java.lang.String domainSource()
          Gets the specific origin of this resource.
protected  int getCodeNum(java.lang.String code)
           
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 java.lang.String getSubType()
          Returns the resource subtype of this rawmaterial.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void quickDestroy()
          A slightly faster version of Contingent.destroy() that eliminates the item from the owner before calling destroy.
 boolean rebundle()
          Scans the owner of this item (room, mob, whatever) for other rawmaterial resources of the exact same kind and, if found, combines with them.
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 void setDomainSource(java.lang.String src)
          Sets the specific origin of this resource.
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 void setSubType(java.lang.String subType)
          Sets the resource subtype of this rawmaterial.
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.GenItem
isGeneric, readableText, setMiscText, setReadableText, text
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
abilityImbuesMagic, addBehavior, addEffect, addNonUninvokableEffect, addScript, affectCharState, affectCharStats, affectPhyStats, alreadyWornMsg, amBeingWornProperly, amDestroyed, amWearingAt, baseGoldValue, basePhyStats, behaviors, canSaveDatabaseID, canWear, canWearComplete, cloneFix, 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, getSaveStatIndex, getTickStatus, I, image, initializeClass, isReadable, isSavable, isStat, L, material, maxRange, minRange, miscTextFormat, name, Name, name, newInstance, numBehaviors, numberOfItems, numEffects, numScripts, okMessage, owner, phyStats, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, recoverPhyStats, recursiveWeight, removeFromOwnerContainer, riding, scripts, secretIdentity, setBasePhyStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadable, setRiding, setSavable, setSecretIdentity, setUsesRemaining, stopTicking, subjectToWearAndTear, tackOns, tick, ultimateContainer, unWear, usesRemaining, value, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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, 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, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, isStat
 
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
 

Field Detail

domainSource

protected java.lang.String domainSource

resourceSubType

protected java.lang.String resourceSubType
Constructor Detail

GenResource

public GenResource()
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, Tech. The name is typically identical to the class name.

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

domainSource

public java.lang.String domainSource()
Description copied from interface: RawMaterial
Gets the specific origin of this resource. If a resource has a specific source that may be of interest to the owner, here it is. For example, if the resource is meat then this may be Cow meat, or Horse meat, making "Cow" and "Horse" the domain source.

Specified by:
domainSource in interface RawMaterial
Returns:
the specific origin of this resource

setDomainSource

public void setDomainSource(java.lang.String src)
Description copied from interface: RawMaterial
Sets the specific origin of this resource. If a resource has a specific source that may be of interest to the owner, here it is. For example, if the resource is meat then this may be Cow meat, or Horse meat, making "Cow" and "Horse" the domain source.

Specified by:
setDomainSource in interface RawMaterial
Parameters:
src - the specific origin of this resource

setSubType

public void setSubType(java.lang.String subType)
Description copied from interface: RawMaterial
Sets the resource subtype of this rawmaterial.

Specified by:
setSubType in interface RawMaterial
Parameters:
subType - the resource subtype
See Also:
RawMaterial.ResourceSubType, RawMaterial.getSubType()

getSubType

public java.lang.String getSubType()
Description copied from interface: RawMaterial
Returns the resource subtype of this rawmaterial.

Specified by:
getSubType in interface RawMaterial
Returns:
the resource subtype
See Also:
RawMaterial.ResourceSubType, RawMaterial.setSubType(String)

rebundle

public boolean rebundle()
Description copied from interface: RawMaterial
Scans the owner of this item (room, mob, whatever) for other rawmaterial resources of the exact same kind and, if found, combines with them. May result in this item being destroyed.

Specified by:
rebundle in interface RawMaterial
Returns:
true if this item was rebundled, false otherwise.

quickDestroy

public void quickDestroy()
Description copied from interface: RawMaterial
A slightly faster version of Contingent.destroy() that eliminates the item from the owner before calling destroy.

Specified by:
quickDestroy in interface RawMaterial

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Overrides:
getStat in class GenItem
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Overrides:
setStat in class GenItem
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)
Overrides:
getCodeNum in class StdItem

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Overrides:
getStatCodes in class GenItem
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

sameAs

public boolean sameAs(Environmental E)
Description copied from interface: Environmental
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Specified by:
sameAs in interface Environmental
Overrides:
sameAs in class GenItem
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String)