com.planet_ink.coffee_mud.Items.MiscMagic
Class StdPlayingCard

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
      extended by com.planet_ink.coffee_mud.Items.MiscMagic.StdPlayingCard
All Implemented Interfaces:
Affectable, Behavable, CMObject, Contingent, DBIdentifiable, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, Rider, StatsAffecting, Tickable, Item, MiscMagic, PlayingCard, Wearable, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenPlayingCard

public class StdPlayingCard
extends StdItem
implements MiscMagic, PlayingCard


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
Wearable.CODES
 
Field Summary
protected  int oldAbility
           
 
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.PlayingCard
cards, suits
 
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
StdPlayingCard()
           
 
Method Summary
protected  boolean abilityImbuesMagic()
           
 int getBitEncodedSuit()
          Returns the bitmap value that represents the suit of this card.
 int getBitEncodedValue()
          Returns the full bit-encoded value of this card, with suit | value.
 java.lang.String getCardValueLongDescription(int value)
          Returns the english-word representation of the value passed to this method.
 java.lang.String getCardValueShortDescription(int value)
          Returns partial english-word representation of the value passed to this method.
 java.lang.String getStringEncodedSuit()
          Returns the suit of this card as a single letter string
 java.lang.String getStringEncodedValue()
          Return the value of this card as a short string face cards are only a single letter
 java.lang.String getSuitDescription(int suit)
          Returns an english-word, color-coded representation of the suit passed to this method.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isFaceUp()
          Gets whether the card is face up
 void recoverPhyStats()
          This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to all surrounding objects with affectPhyStats(Environmental,PhyStats) method.
 void turnFaceDown()
          Sets the card as face down
 void turnFaceUp()
          Sets the card as face up
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
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, getCodeNum, getSaveStatIndex, getStat, getStatCodes, getTickStatus, I, image, initializeClass, isGeneric, isReadable, isSavable, isStat, L, material, maxRange, minRange, miscTextFormat, name, Name, name, newInstance, numBehaviors, numberOfItems, numEffects, numScripts, okMessage, owner, phyStats, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, 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, tackOns, text, 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.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
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

oldAbility

protected int oldAbility
Constructor Detail

StdPlayingCard

public StdPlayingCard()
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 StdItem
Returns:
the name of this class

abilityImbuesMagic

protected boolean abilityImbuesMagic()
Overrides:
abilityImbuesMagic in class StdItem

getBitEncodedSuit

public int getBitEncodedSuit()
Description copied from interface: PlayingCard
Returns the bitmap value that represents the suit of this card.

Specified by:
getBitEncodedSuit in interface PlayingCard
Returns:
the bitmap value that represents the suit of this card
See Also:
PlayingCard.suits

getBitEncodedValue

public int getBitEncodedValue()
Description copied from interface: PlayingCard
Returns the full bit-encoded value of this card, with suit | value.

Specified by:
getBitEncodedValue in interface PlayingCard
Returns:
the full bit-encoded value of this card
See Also:
PlayingCard.suits, The card values are 2-14, the suit bitmasks are 0, 16, 32, and 48. Face up is bit 64.

isFaceUp

public boolean isFaceUp()
Description copied from interface: PlayingCard
Gets whether the card is face up

Specified by:
isFaceUp in interface PlayingCard
Returns:
true if the card is face up, false if down
See Also:
PlayingCard.turnFaceUp(), Face up is bit 64.

turnFaceUp

public void turnFaceUp()
Description copied from interface: PlayingCard
Sets the card as face up

Specified by:
turnFaceUp in interface PlayingCard
See Also:
PlayingCard.isFaceUp(), Face up is bit 64.

turnFaceDown

public void turnFaceDown()
Description copied from interface: PlayingCard
Sets the card as face down

Specified by:
turnFaceDown in interface PlayingCard
See Also:
PlayingCard.isFaceUp(), Face up is bit 64.

getStringEncodedSuit

public java.lang.String getStringEncodedSuit()
Description copied from interface: PlayingCard
Returns the suit of this card as a single letter string

Specified by:
getStringEncodedSuit in interface PlayingCard
Returns:
the suit of this card as a single letter string

getStringEncodedValue

public java.lang.String getStringEncodedValue()
Description copied from interface: PlayingCard
Return the value of this card as a short string face cards are only a single letter

Specified by:
getStringEncodedValue in interface PlayingCard
Returns:
the value of this card as a short string

getCardValueLongDescription

public java.lang.String getCardValueLongDescription(int value)
Description copied from interface: PlayingCard
Returns the english-word representation of the value passed to this method. Since this method is static, it may be called as a utility function and does not necessarily represent THIS card object.

Specified by:
getCardValueLongDescription in interface PlayingCard
Parameters:
value - the value to return a description of
Returns:
the value passed in as a string

getCardValueShortDescription

public java.lang.String getCardValueShortDescription(int value)
Description copied from interface: PlayingCard
Returns partial english-word representation of the value passed to this method. By partial I mean numeric for number cards and words otherwise. Since this method is static, it may be called as a utility function and does not necessarily represent THIS card object.

Specified by:
getCardValueShortDescription in interface PlayingCard
Parameters:
value - the value to return a description of
Returns:
the value passed in as a string

getSuitDescription

public java.lang.String getSuitDescription(int suit)
Description copied from interface: PlayingCard
Returns an english-word, color-coded representation of the suit passed to this method. Since this method is static, it may be called as a utility function and does not necessarily represent THIS card object.

Specified by:
getSuitDescription in interface PlayingCard
Parameters:
suit - the suit to return a description of
Returns:
the suit passed in as a string

recoverPhyStats

public void recoverPhyStats()
Description copied from interface: Affectable
This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to all surrounding objects with affectPhyStats(Environmental,PhyStats) 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 phyStats() object. When it returns, phyStats() 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:
recoverPhyStats in interface Affectable
Overrides:
recoverPhyStats in class StdItem
See Also:
Affectable.basePhyStats(), Affectable.phyStats(), Affectable.addEffect(Ability), Behavable.addBehavior(Behavior), PhyStats