com.planet_ink.coffee_mud.MOBS.interfaces
Interface Banker

All Superinterfaces:
java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, Economics, Environmental, Modifiable, MsgListener, ShopKeeper, StatsAffecting, Tickable
All Known Implementing Classes:
GenBanker, StdBanker

public interface Banker
extends ShopKeeper

A Banker is a kind of shopkeeper that belongs to a "chain" which shares access to a common store of player/clan accounts to hold money and items. Players must go to a banker in the same chain to retrieve money and items deposited with the chain. Bankers respond to new commands such as DEPOSIT and WITHDRAW that normal shopkeepers do not. Bankers also respect marriage by giving both parters access to each others accounts. Bankers can serve an entire clan, or a single player.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
ShopKeeper.ShopPrice
 
Field Summary
static double MIN_ITEM_BALANCE_DIVISOR
          The default value by which the value of items is divided to determine minimum money to continue item storage.
 
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_BOOKS, DEAL_BUTCHER, DEAL_CASTER, DEAL_CLANBANKER, DEAL_CLANDSELLER, DEAL_CLANPOSTMAN, DEAL_CONFLICTS, DEAL_CSHIPSELLER, DEAL_DESCS, DEAL_FOODSELLER, DEAL_GENERAL, DEAL_GROWER, DEAL_HIDESELLER, DEAL_INNKEEPER, DEAL_INSTRUMENTS, DEAL_INVENTORYONLY, DEAL_JEWELLER, DEAL_LANDSELLER, DEAL_LEATHER, DEAL_LUMBERER, DEAL_MAGIC, DEAL_METALSMITH, DEAL_PETS, DEAL_POSTMAN, DEAL_READABLES, DEAL_SHIPSELLER, DEAL_SLAVES, DEAL_STONEYARDER, DEAL_TRAINER, DEAL_WEAPONS
 
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
 
Method Summary
 void addDepositInventory(java.lang.String depositorName, Item item, Item container)
          Deposits a new item into the given account.
 java.lang.String bankChain()
          Gets the name of the bank chain to which this banker belongs.
 void delAllDeposits(java.lang.String depositorName)
          Empties all the items and money from a given depositors box.
 java.util.List<Item> delDepositInventory(java.lang.String depositorName, Item likeItem)
          Deletes item into the given account.
 Item findDepositInventory(java.lang.String mob, java.lang.String likeThis)
          Searches the deposit inventory for an item with a substring name like the one given, returning the first found.
 java.util.List<java.lang.String> getAccountNames()
          Returns all the player and clan names who have open accounts at this bank.
 double getBalance(java.lang.String depositorName)
          Returns the money balance in the account, in base value
 java.lang.String getBankClientName(MOB mob, Clan.Function func, boolean checked)
          When the given mob tries to deposit or withdraw something, this method is called to get the proper account name, which is either the mob themselves or their clan, if they are (optionally) permitted by their rank.
 double getCoinInterest()
          Gets the interest rate paid (or cost) on deposited money.
 MoneyLibrary.DebtItem getDebtInfo(java.lang.String depositorName)
          Returns debt information for the given depositor to this bank chain.
 java.util.List<Item> getDepositedItems(java.lang.String depositorName)
          Returns all of the items deposited in the account.
 double getItemInterest()
          Gets the interest rate paid (or cost) on the value of deposited items.
 double getLoanInterest()
          Gets the interest rate paid (or cost) on loaned out funds as debt.
 int numberDeposited(java.lang.String depositorName)
          Returns the number of items deposited, including money items
 void setBankChain(java.lang.String name)
          Sets the name of the bank chain to which this banker belongs.
 void setCoinInterest(double interest)
          Sets the interest rate paid (or cost) on deposited money.
 void setItemInterest(double interest)
          Sets the interest rate paid (or cost) on the value of deposited items.
 void setLoanInterest(double interest)
          Sets the interest rate paid (or cost) on loaned out funds as debt.
 double totalItemsWorth(java.lang.String depositorName)
          Returns the base money value of all items deposited in the given account.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
addSoldType, doISellThis, getShop, getWhatIsSoldMask, getWhatIsSoldZappermask, isSold, setWhatIsSoldMask, setWhatIsSoldZappermask, 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
 
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
 

Field Detail

MIN_ITEM_BALANCE_DIVISOR

static final double MIN_ITEM_BALANCE_DIVISOR
The default value by which the value of items is divided to determine minimum money to continue item storage. Default is needing 10% of item value in money to store.

See Also:
Constant Field Values
Method Detail

getCoinInterest

double getCoinInterest()
Gets the interest rate paid (or cost) on deposited money. A positive value is a payment, a negative is a cost.

Returns:
the interest rate paid (or cost) on deposited money.
See Also:
setCoinInterest(double)

setCoinInterest

void setCoinInterest(double interest)
Sets the interest rate paid (or cost) on deposited money. A positive value is a payment, a negative is a cost.

Parameters:
interest - the interest rate paid (or cost) on deposited money.
See Also:
getCoinInterest()

getItemInterest

double getItemInterest()
Gets the interest rate paid (or cost) on the value of deposited items. A positive value is a payment, a negative is a cost.

Returns:
the interest rate paid (or cost) on deposited items.
See Also:
setItemInterest(double)

setItemInterest

void setItemInterest(double interest)
Sets the interest rate paid (or cost) on the value of deposited items. A positive value is a payment, a negative is a cost.

Parameters:
interest - the interest rate paid (or cost) on deposited items.
See Also:
getItemInterest()

getLoanInterest

double getLoanInterest()
Gets the interest rate paid (or cost) on loaned out funds as debt. A positive value is a cost, a negative is a bonus.

Returns:
the interest rate paid (or cost) on loaned money debt.
See Also:
setLoanInterest(double)

setLoanInterest

void setLoanInterest(double interest)
Sets the interest rate paid (or cost) on loaned out funds as debt. A positive value is a cost, a negative is a bonus.

Parameters:
interest - the interest rate paid (or cost) on loaned money debt.
See Also:
getLoanInterest()

bankChain

java.lang.String bankChain()
Gets the name of the bank chain to which this banker belongs.

Returns:
the bank chain name
See Also:
setBankChain(String)

setBankChain

void setBankChain(java.lang.String name)
Sets the name of the bank chain to which this banker belongs.

Parameters:
name - the bank chain name
See Also:
bankChain()

getAccountNames

java.util.List<java.lang.String> getAccountNames()
Returns all the player and clan names who have open accounts at this bank.

Returns:
all the player and clan names who have open accounts

getBankClientName

java.lang.String getBankClientName(MOB mob,
                                   Clan.Function func,
                                   boolean checked)
When the given mob tries to deposit or withdraw something, this method is called to get the proper account name, which is either the mob themselves or their clan, if they are (optionally) permitted by their rank. If checked is true, and the mob does NOT have clan privileges, then an error message is given to the mob and null is returned.

Parameters:
mob - the mob who is trying to deposit or withdraw or list or something
func - either Clan.Function.WITHDRAW or Clan.FUNCTION.DEPOSIT or LIST
checked - true if the mob must have clan privileges, false if not.
Returns:
the mobs name, their clan name, or null
See Also:
Clan.Function

getDebtInfo

MoneyLibrary.DebtItem getDebtInfo(java.lang.String depositorName)
Returns debt information for the given depositor to this bank chain.

Parameters:
depositorName - the player or clan name that owes the bank money
Returns:
information about the debt
See Also:
MoneyLibrary.DebtItem

addDepositInventory

void addDepositInventory(java.lang.String depositorName,
                         Item item,
                         Item container)
Deposits a new item into the given account. Coin items are, of course, money.

Parameters:
depositorName - the account to deposit into, like mob or clan name
item - the item to deposit
container - the container the item is in, which also needs depositing
See Also:
delAllDeposits(String), delDepositInventory(String, Item), getBalance(String)

delDepositInventory

java.util.List<Item> delDepositInventory(java.lang.String depositorName,
                                         Item likeItem)
Deletes item into the given account. Coin items are, of course, money. The items are returned in a list to the caller. If the item is a container, all contained items are also returned.

Parameters:
depositorName - the account to delete from, like mob or clan name
likeItem - the likeItem to delete
Returns:
the collection of items deleted from the account
See Also:
delAllDeposits(String), addDepositInventory(String, Item, Item), getBalance(String)

delAllDeposits

void delAllDeposits(java.lang.String depositorName)
Empties all the items and money from a given depositors box.

Parameters:
depositorName - the account to empty, like mob or clan name
See Also:
delDepositInventory(String, Item), addDepositInventory(String, Item, Item), getBalance(String)

getBalance

double getBalance(java.lang.String depositorName)
Returns the money balance in the account, in base value

Parameters:
depositorName - the account to empty, like mob or clan name
Returns:
the money balance, in base value
See Also:
delDepositInventory(String, Item), addDepositInventory(String, Item, Item), delAllDeposits(String)

numberDeposited

int numberDeposited(java.lang.String depositorName)
Returns the number of items deposited, including money items

Parameters:
depositorName - the account to size up, like mob or clan name
Returns:
the number of items in the account
See Also:
getDepositedItems(String), findDepositInventory(String, String), totalItemsWorth(String)

getDepositedItems

java.util.List<Item> getDepositedItems(java.lang.String depositorName)
Returns all of the items deposited in the account. Make sure you destroy these when you are done looking at them!

Parameters:
depositorName - the account to return, like mob or clan name
Returns:
the list of all items in the account
See Also:
numberDeposited(String), findDepositInventory(String, String), totalItemsWorth(String)

findDepositInventory

Item findDepositInventory(java.lang.String mob,
                          java.lang.String likeThis)
Searches the deposit inventory for an item with a substring name like the one given, returning the first found. If the search string resembles a number at all, this will return the Coins item in the account.

Parameters:
mob - the player or clan name of the account to search
likeThis - the search string
Returns:
the item found, or null.
See Also:
getDepositedItems(String), numberDeposited(String), totalItemsWorth(String)

totalItemsWorth

double totalItemsWorth(java.lang.String depositorName)
Returns the base money value of all items deposited in the given account.

Parameters:
depositorName - the account to account for, like mob or clan name
Returns:
the base money value of all items deposited
See Also:
getDepositedItems(String), numberDeposited(String), findDepositInventory(String, String)