com.planet_ink.coffee_mud.MOBS
Class StdBanker

java.lang.Object
  extended by com.planet_ink.coffee_mud.MOBS.StdMOB
      extended by com.planet_ink.coffee_mud.MOBS.StdShopKeeper
          extended by com.planet_ink.coffee_mud.MOBS.StdBanker
All Implemented Interfaces:
Behavable, CMModifiable, CMObject, Economics, Environmental, MsgListener, Rider, ShopKeeper, StatsAffecting, Tickable, Banker, MOB, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenBanker

public class StdBanker
extends StdShopKeeper
implements Banker


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
ShopKeeper.ShopPrice
 
Field Summary
protected static java.util.Hashtable bankTimes
           
protected  double coinInterest
           
protected  double itemInterest
           
protected  double loanInterest
           
 
Fields inherited from class com.planet_ink.coffee_mud.MOBS.StdShopKeeper
budget, budgetMax, budgetRemaining, budgetTickDown, devalueRate, invResetRate, invResetTickDown, pricingAdjustments, shop, whatISell
 
Fields inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
abilities, affects, AgeHours, Alignment, amDead, amDestroyed, amFollowing, atRange, attributesBitmap, baseCharStats, baseEnvStats, baseState, behaviors, charStats, clanID, clanRole, CODES, commandQue, curState, databaseID, DeityIndex, description, displayText, envStats, Experience, expertises, factions, followers, imageName, imMobile, inventory, kickFlag, lastLocation, LiegeID, location, maxState, miscText, Money, moneyVariation, mySession, peaceTime, playerStats, pleaseDestroy, Practices, QuestPoint, riding, scripts, soulMate, startRoomPossibly, tattoos, tickCounter, tickStatus, Trains, Username, victim, WimpHitPoint, WorshipCharID, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.Banker
MIN_ITEM_BALANCE_DIVIDEND
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
DEAL_ALCHEMIST, DEAL_ANYTECHNOLOGY, DEAL_ANYTHING, DEAL_ARMOR, DEAL_AUCTIONEER, DEAL_BANKER, DEAL_BUTCHER, DEAL_CASTER, DEAL_CLANBANKER, DEAL_CLANDSELLER, DEAL_CLANPOSTMAN, DEAL_CSHIPSELLER, DEAL_DESCS, DEAL_FOODSELLER, DEAL_GENERAL, DEAL_GROWER, DEAL_HIDESELLER, DEAL_INNKEEPER, DEAL_INVENTORYONLY, DEAL_JEWELLER, DEAL_LANDSELLER, DEAL_LEATHER, DEAL_LUMBERER, DEAL_MAGIC, DEAL_METALSMITH, DEAL_PETS, DEAL_POSTMAN, DEAL_SHIPSELLER, DEAL_SLAVES, DEAL_STONEYARDER, DEAL_TRAINER, DEAL_WEAPONS
 
Fields inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
ATT_ANSI, ATT_AUTOASSIST, ATT_AUTODRAW, ATT_AUTOEXITS, ATT_AUTOFORWARD, ATT_AUTOGOLD, ATT_AUTOGUARD, ATT_AUTOIMPROVE, ATT_AUTOLOOT, ATT_AUTOMELEE, ATT_AUTONOTIFY, ATT_AUTORUN, ATT_AUTOWEATHER, ATT_BRIEF, ATT_COMPRESS, ATT_DAILYMESSAGE, ATT_MXP, ATT_NOFOLLOW, ATT_NOTEACH, ATT_PLAYERKILL, ATT_QUIET, ATT_SOUND, ATT_SYSOPMSGS, AUTODESC, AUTOREV, SHEATH_TIME
 
Constructor Summary
StdBanker()
           
 
Method Summary
 void addDepositInventory(MOB mob, Item thisThang)
           
 void addDepositInventory(java.lang.String mob, Item thisThang)
           
 java.lang.String bankChain()
           
 void bankLedger(MOB mob, java.lang.String msg)
           
 void bringToLife(Room newLocation, boolean resetStats)
           
 void delAllDeposits(java.lang.String mob)
           
 boolean delDepositInventory(MOB mob, Item thisThang)
           
 boolean delDepositInventory(java.lang.String mob, Item thisThang)
           
 void destroy()
          Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 Item findDepositInventory(MOB mob, java.lang.String likeThis)
           
 Item findDepositInventory(java.lang.String mob, java.lang.String likeThis)
           
 java.util.Vector getAccountNames()
           
 double getBalance(MOB mob)
           
 double getCoinInterest()
           
 java.util.Vector getDebtInfo(MOB mob)
           
 java.util.Vector getDepositedItems(MOB mob)
           
 java.util.Vector getDepositedItems(java.lang.String mob)
           
 double getItemInterest()
           
 double getLoanInterest()
           
 java.util.Vector getRawPDDepositInventory(java.lang.String mob)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
protected  Item makeItem(java.lang.String data)
           
 int numberDeposited(java.lang.String mob)
           
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 void setBankChain(java.lang.String name)
           
 void setCoinInterest(double interest)
           
 void setItemInterest(double interest)
           
 void setLoanInterest(double interest)
           
 void setWhatIsSold(int newSellCode)
          Sets the ShopKeeper DEAL_* constant describing what is sold or bought by this ShopKeeper
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 long timeInterval()
           
 double totalItemsWorth(MOB mob)
           
 int whatIsSold()
          Returns the ShopKeeper DEAL_* constant describing what is sold or bought by this ShopKeeper
 
Methods inherited from class com.planet_ink.coffee_mud.MOBS.StdShopKeeper
budget, cloneFix, devalueRate, doISellThis, finalBudget, finalDevalueRate, finalIgnoreMask, finalInvResetRate, finalItemPricingAdjustments, finalPrejudiceFactors, getShop, getStartArea, ignoreMask, invResetRate, itemPricingAdjustments, prejudiceFactors, processVariableEquipment, setBudget, setDevalueRate, setIgnoreMask, setInvResetRate, setItemPricingAdjustments, setPrejudiceFactors, storeKeeperString
 
Methods inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
actions, addAbility, addBehavior, addEffect, addExpertise, addFaction, addFollower, addInventory, addNonUninvokableEffect, addPriorityEffect, addScript, addTattoo, adjustedArmor, adjustedAttackBonus, adjustedDamage, adjustFaction, affectCharState, affectCharStats, affectEnvStats, amActive, amDead, amDestroyed, amFollowing, amUltimatelyFollowing, baseCharStats, baseEnvStats, baseState, baseWeight, bringToLife, calculateTickDelay, charStats, cloneEffects, commandQueSize, compareTo, confirmWearability, copyFactions, copyOf, curState, databaseID, delAbility, delBehavior, delEffect, delExpertise, delFollower, delInventory, delScript, delTattoo, dequeCommand, description, displayName, displayText, displayText, dispossess, doCommand, doCommand, enqueCommand, envStats, expirationDate, fetchAbility, fetchAbility, fetchBehavior, fetchBehavior, fetchCarried, fetchEffect, fetchEffect, fetchExpertise, fetchExpertise, fetchFaction, fetchFactionRanges, fetchFactions, fetchFirstWornItem, fetchFollower, fetchFollower, fetchFollowerOrder, fetchFromInventory, fetchInventory, fetchInventory, fetchInventory, fetchScript, fetchTattoo, fetchTattoo, fetchWieldedItem, fetchWornItem, fetchWornItems, finalize, findAbility, flagVariableEq, freeWearPositions, genericName, getAgeHours, getBitmap, getClanID, getClanRole, getCodeNum, getExperience, getExpNeededDelevel, getExpNeededLevel, getExpNextLevel, getExpPrevLevel, getFactionListing, getGroupMembers, getLiegeID, getMoney, getMoneyVariation, getMyDeity, getPractices, getQuestPoint, getRideBuddies, getSaveStatIndex, getStartRoom, getStat, getStatCodes, getTickStatus, getTrains, getVictim, getWearPositions, getWimpHitPoint, getWorshipCharID, giveItem, hasFaction, hasOnlyGoldInInventory, healthText, image, initializeClass, inventorySize, isFollowedBy, isGeneric, isInCombat, isMarriedToLiege, isMine, isMonster, isPossessing, isStat, killMeDead, lastTickedDateTime, location, makePeace, maxCarry, maxFollowers, maxItems, maxRange, maxRange, maxState, mayIFight, mayPhysicallyAttack, minRange, minRange, miscTextFormat, myNaturalWeapon, name, Name, newInstance, numAbilities, numAllEffects, numBehaviors, numEffects, numExpertises, numFollowers, numLearnedAbilities, numScripts, numTattoos, peaceTime, playerStats, prequeCommand, rangeToTarget, rawImage, recoverCharStats, recoverEnvStats, recoverMaxState, removeFaction, removeFromGame, resetToMaxState, resetVectors, riding, sameAs, savable, session, setActions, setAgeHours, setAtRange, setBaseCharStats, setBaseEnvStats, setBaseState, setBitmap, setClanID, setClanRole, setDatabaseID, setDescription, setDisplayText, setExperience, setExpirationDate, setExpNextLevel, setFollowing, setImage, setLiegeID, setLocation, setMiscText, setMoney, setMoneyVariation, setName, setPlayerStats, setPractices, setQuestPoint, setRiding, setSession, setSoulMate, setStartRoom, setStat, setTrains, setVictim, setWimpHitPoint, setWorshipCharID, soulMate, tell, tell, text, titledName, totalFollowers, uniqueExpertises, willFollowOrdersOf
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
doISellThis, getShop, storeKeeperString
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Economics
budget, devalueRate, finalBudget, finalDevalueRate, finalIgnoreMask, finalInvResetRate, finalItemPricingAdjustments, finalPrejudiceFactors, ignoreMask, invResetRate, itemPricingAdjustments, prejudiceFactors, setBudget, setDevalueRate, setIgnoreMask, setInvResetRate, setItemPricingAdjustments, setPrejudiceFactors
 

Field Detail

coinInterest

protected double coinInterest

itemInterest

protected double itemInterest

loanInterest

protected double loanInterest

bankTimes

protected static java.util.Hashtable bankTimes
Constructor Detail

StdBanker

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

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

destroy

public void destroy()
Description copied from interface: Environmental
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have their destroy() method called will also call the destroy() methods on all items and other objects listed as content, recursively.

Specified by:
destroy in interface Environmental
Overrides:
destroy in class StdMOB

bringToLife

public void bringToLife(Room newLocation,
                        boolean resetStats)
Specified by:
bringToLife in interface MOB
Overrides:
bringToLife in class StdMOB

whatIsSold

public int whatIsSold()
Description copied from interface: ShopKeeper
Returns the ShopKeeper DEAL_* constant describing what is sold or bought by this ShopKeeper

Specified by:
whatIsSold in interface ShopKeeper
Overrides:
whatIsSold in class StdShopKeeper
Returns:
the dealer constant
See Also:
ShopKeeper

setWhatIsSold

public void setWhatIsSold(int newSellCode)
Description copied from interface: ShopKeeper
Sets the ShopKeeper DEAL_* constant describing what is sold or bought by this ShopKeeper

Specified by:
setWhatIsSold in interface ShopKeeper
Overrides:
setWhatIsSold in class StdShopKeeper
Parameters:
newSellCode - the dealer type constant
See Also:
ShopKeeper

bankChain

public java.lang.String bankChain()
Specified by:
bankChain in interface Banker

setBankChain

public void setBankChain(java.lang.String name)
Specified by:
setBankChain in interface Banker

addDepositInventory

public void addDepositInventory(java.lang.String mob,
                                Item thisThang)
Specified by:
addDepositInventory in interface Banker

addDepositInventory

public void addDepositInventory(MOB mob,
                                Item thisThang)
Specified by:
addDepositInventory in interface Banker

delDepositInventory

public boolean delDepositInventory(MOB mob,
                                   Item thisThang)
Specified by:
delDepositInventory in interface Banker

makeItem

protected Item makeItem(java.lang.String data)

delDepositInventory

public boolean delDepositInventory(java.lang.String mob,
                                   Item thisThang)
Specified by:
delDepositInventory in interface Banker

delAllDeposits

public void delAllDeposits(java.lang.String mob)
Specified by:
delAllDeposits in interface Banker

numberDeposited

public int numberDeposited(java.lang.String mob)
Specified by:
numberDeposited in interface Banker

getDepositedItems

public java.util.Vector getDepositedItems(MOB mob)
Specified by:
getDepositedItems in interface Banker

getDepositedItems

public java.util.Vector getDepositedItems(java.lang.String mob)
Specified by:
getDepositedItems in interface Banker

getRawPDDepositInventory

public java.util.Vector getRawPDDepositInventory(java.lang.String mob)
Specified by:
getRawPDDepositInventory in interface Banker

getAccountNames

public java.util.Vector getAccountNames()
Specified by:
getAccountNames in interface Banker

bankLedger

public void bankLedger(MOB mob,
                       java.lang.String msg)

findDepositInventory

public Item findDepositInventory(MOB mob,
                                 java.lang.String likeThis)
Specified by:
findDepositInventory in interface Banker

findDepositInventory

public Item findDepositInventory(java.lang.String mob,
                                 java.lang.String likeThis)
Specified by:
findDepositInventory in interface Banker

timeInterval

public long timeInterval()

setCoinInterest

public void setCoinInterest(double interest)
Specified by:
setCoinInterest in interface Banker

setItemInterest

public void setItemInterest(double interest)
Specified by:
setItemInterest in interface Banker

getCoinInterest

public double getCoinInterest()
Specified by:
getCoinInterest in interface Banker

getItemInterest

public double getItemInterest()
Specified by:
getItemInterest in interface Banker

setLoanInterest

public void setLoanInterest(double interest)
Specified by:
setLoanInterest in interface Banker

getLoanInterest

public double getLoanInterest()
Specified by:
getLoanInterest in interface Banker

getDebtInfo

public java.util.Vector getDebtInfo(MOB mob)
Specified by:
getDebtInfo in interface Banker

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Overrides:
tick in class StdShopKeeper
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

getBalance

public double getBalance(MOB mob)
Specified by:
getBalance in interface Banker

totalItemsWorth

public double totalItemsWorth(MOB mob)
Specified by:
totalItemsWorth in interface Banker

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdShopKeeper
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Overrides:
okMessage in class StdShopKeeper
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()