com.planet_ink.coffee_mud.MOBS
Class StdShopKeeper

java.lang.Object
  extended by com.planet_ink.coffee_mud.MOBS.StdMOB
      extended by com.planet_ink.coffee_mud.MOBS.StdShopKeeper
All Implemented Interfaces:
AbilityContainer, Affectable, Behavable, CMObject, Combatant, Contingent, DBIdentifiable, Economics, Environmental, FactionMember, Followable<MOB>, ItemCollection, ItemPossessor, Modifiable, MsgListener, MUDCmdProcessor, Physical, PhysicalAgent, Rider, ShopKeeper, StatsAffecting, Tattooable, Tickable, MOB, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenShopkeeper, StdBanker, StdLibrarian, StdPostman

public class StdShopKeeper
extends StdMOB
implements ShopKeeper


Nested Class Summary
 
Nested classes/interfaces inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
StdMOB.ApplyAffectCharState<T extends StatsAffecting>, StdMOB.ApplyAffectCharStats<T extends StatsAffecting>, StdMOB.ApplyRecAffectPhyStats<T extends StatsAffecting>
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
ShopKeeper.ShopPrice
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
MOB.Attrib
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
 
Field Summary
protected  Pair<java.lang.Long,TimeClock.TimePeriod> budget
           
protected  long budgetMax
           
protected  long budgetRemaining
           
protected  int budgetTickDown
           
protected  double[] devalueRate
           
protected  int invResetRate
           
protected  int invResetTickDown
           
protected  java.lang.String itemZapperMask
           
protected  java.lang.String[] pricingAdjustments
           
protected  CoffeeShop shop
           
protected  long whatIsSoldMask
           
 
Fields inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
abilitys, abilityUseCache, abilityUseTrig, affectCharState, affectCharStats, affectPhyStats, affects, ageMinutes, amDead, amDestroyed, amFollowing, atRange, attributesBitmap, baseCharStats, basePhyStats, baseState, behaviors, cachedImageName, charStats, clanAffects, clans, CODES, commandQue, curState, databaseID, description, displayText, experience, expertises, factions, followers, inventory, kickFlag, lastLocation, liegeID, location, maxState, me, miscText, money, moneyVariation, mySession, peaceTime, phyStats, playerStats, possHeldItem, possStartRoom, possWieldedItem, practices, questPoint, racialAffects, rawImageName, recoverAffectP, recoverTickCter, removeFromGame, riding, scripts, soulMate, tattoos, tickAgeCounter, tickStatus, trains, username, victim, wimpHitPoint, worshipCharID, xtraValues
 
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
 
Fields inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
AGE_MILLIS_THRESHOLD, END_SHEATH_TIME, START_SHEATH_TIME
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.MUDCmdProcessor
METAFLAG_AS, METAFLAG_ASMESSAGE, METAFLAG_FORCED, METAFLAG_INORDER, METAFLAG_MPFORCED, METAFLAG_ORDER, METAFLAG_POSSESSED, METAFLAG_SNOOPED
 
Constructor Summary
StdShopKeeper()
           
 
Method Summary
 void addSoldType(int mask)
          Adds the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper to the existing shopkeeper mask.
 java.lang.String budget()
          Returns a description of the buying budget of the shopkeeper.
protected  void cloneFix(MOB E)
           
 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.
 java.lang.String devalueRate()
          Returns a string describing the percentage in the drop of the price at which this ShopKeeper will buy back items based on the number already in his inventory.
protected  void doInventoryReset()
           
 boolean doISellThis(Environmental thisThang)
          Returns whether this ShopKeeper deals in the type of item passed in.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 Pair<java.lang.Long,TimeClock.TimePeriod> finalBudget()
          Returns a description of the buying budget of the shopkeeper.
 double[] finalDevalueRate()
          Returns a double array describing the percentage in the drop of the price at which this ShopKeeper will buy back items based on the number already in his inventory.
 java.lang.String finalIgnoreMask()
          Returns the mask used to determine if a customer is ignored by the ShopKeeper.
 int finalInvResetRate()
          Returns the number of ticks between totally resetting this ShopKeepers inventory back to what it was.
 java.lang.String[] finalItemPricingAdjustments()
          A string set describing how pricing for this ShopKeeper will differ based on item masks The format for each string is a floating point number followers by a space and a zapper mask
 java.lang.String finalPrejudiceFactors()
          A string describing how pricing for this ShopKeeper will differ based on customer attributes such as race.
 CoffeeShop getShop()
          the CoffeeShop method to access the shopkeepers store of goods
protected  Area getStartArea()
           
 long getWhatIsSoldMask()
          Returns the ShopKeeper DEAL_* mask describing what is sold or bought by this ShopKeeper
 java.lang.String getWhatIsSoldZappermask()
          Returns the zapper mask which applies to items to determine whether they are bought and solid by this shopkeeper.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 java.lang.String ignoreMask()
          Returns the mask used to determine if a customer is ignored by the ShopKeeper.
 int invResetRate()
          Returns the number of ticks between totally resetting this ShopKeepers inventory back to what it was.
 boolean isSold(int mask)
          Returns whether the given type of good is sold by this shopkeeper.
 java.lang.String[] itemPricingAdjustments()
          A string set describing how pricing for this ShopKeeper will differ based on item masks The format for each string is a floating point number followers by a space and a zapper mask
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 java.lang.String prejudiceFactors()
          A string describing how pricing for this ShopKeeper will differ based on customer attributes such as race.
 void setBudget(java.lang.String factors)
          Sets a description of the buying budget of the shopkeeper.
 void setDevalueRate(java.lang.String factors)
          Sets a string describing the percentage in the drop of the price at which this ShopKeeper will buy back items based on the number already in his inventory.
 void setIgnoreMask(java.lang.String factors)
          Sets the mask used to determine if a customer is ignored by the ShopKeeper.
 void setInvResetRate(int ticks)
          Sets the number of ticks between totally resetting this ShopKeepers inventory back to what it was.
 void setItemPricingAdjustments(java.lang.String[] factors)
          Sets the string set describing how pricing for this ShopKeeper will differ based on item masks The format for each string is a floating point number followers by a space and a zapper mask
 void setPrejudiceFactors(java.lang.String factors)
          Sets the string describing how pricing for this ShopKeeper will differ based on customer attributes such as race.
 void setWhatIsSoldMask(long newSellCode)
          Sets the encoded ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
 void setWhatIsSoldZappermask(java.lang.String newSellMask)
          Sets the zapper mask which applies to items to determine whether they are bought and solid by this shopkeeper.
 java.lang.String storeKeeperString()
          Based on the value of this ShopKeepers whatIsSold() method, this will return a displayable string describing that type.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 
Methods inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
abilities, actions, addAbility, addBehavior, addEffect, addExpertise, addFaction, addFollower, addItem, addItem, addNonUninvokableEffect, addPriorityEffect, addScript, addTattoo, addTattoo, addTattoo, adjustFaction, affectCharState, affectCharStats, affectPhyStats, allAbilities, amActive, amDead, amDestroyed, amFollowing, amUltimatelyFollowing, baseCharStats, basePhyStats, baseState, baseWeight, behaviors, bringToLife, bringToLife, calculateActionCost, canSaveDatabaseID, charStats, clanEffects, clans, clearCommandQueue, commandQueSize, compareTo, confirmLocation, copyFactions, copyOf, curState, databaseID, delAbility, delAllAbilities, delAllBehaviors, delAllEffects, delAllExpertises, delAllItems, delAllScripts, delBehavior, delEffect, delExpertise, delFollower, delItem, delScript, delTattoo, delTattoo, dequeCommand, description, description, displayText, displayText, dispossess, doCommand, doCommand, eachBehavior, eachEffect, eachItem, eachScript, effects, enqueCommand, enqueCommands, expertises, expirationDate, factions, fetchAbility, fetchAbility, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchExpertise, fetchFaction, fetchFactionData, fetchFactionRanges, fetchFirstWornItem, fetchFollower, fetchFollower, fetchFollowerOrder, fetchFromInventory, fetchHeldItem, fetchItem, fetchRandomAbility, fetchScript, fetchWieldedItem, fetchWornItems, findAbility, findItem, findItem, findItems, findItems, findTattoo, findTattooStartsWith, fixChannelColors, flagVariableEq, followers, freeWearPositions, genericName, getAbilityUsageCache, getAgeMinutes, getAttributesBitmap, getClanRole, getCodeNum, getCombatant, getDirectionToTarget, getExperience, getExpNeededDelevel, getExpNeededLevel, getExpNextLevel, getExpPrevLevel, getFactionListing, getGroupMembers, getGroupMembersAndRideables, getItem, getLiegeID, getMoney, getMoneyVariation, getMyDeity, getNaturalWeapon, getPeaceTime, getPractices, getQuestPoint, getRandomItem, getRideBuddies, getSaveStatIndex, getStartRoom, getStat, getStatCodes, getTickStatus, getTrains, getVictim, getWearPositions, getWimpHitPoint, getWorshipCharID, hasFaction, hasOnlyGoldInInventory, healthText, image, initializeClass, isAttributeSet, isContent, isEitherOfUsDead, isFollowedBy, isGeneric, isInCombat, isMarriedToLiege, isMine, isMonster, isPermissableToFight, isPlayer, isPossessing, isRacialAbility, isSavable, isStat, items, killMeDead, L, lastTickedDateTime, location, makePeace, maxCarry, maxFollowers, maxItems, maxRange, maxState, mayIFight, mayPhysicallyAttack, minRange, miscTextFormat, moveItemTo, moveItemTo, name, Name, name, newInstance, numAbilities, numAllAbilities, numAllEffects, numBehaviors, numEffects, numFollowers, numItems, numScripts, personalEffects, phyStats, playerStats, prequeCommand, prequeCommands, racialEffects, rangeToTarget, rawImage, recoverCharStats, recoverMaxState, recoverPhyStats, removeFaction, removeFromGame, resetToMaxState, riding, sameAs, scripts, session, setActions, setAgeMinutes, setAttribute, setAttributesBitmap, setBaseCharStats, setBasePhyStats, setBaseState, setClan, setCombatant, setDatabaseID, setDescription, setDisplayText, setExperience, setExpirationDate, setFollowing, setImage, setLiegeID, setLocation, setMiscText, setMoney, setMoneyVariation, setName, setPlayerStats, setPractices, setQuestPoint, setRangeToTarget, setRiding, setSavable, setSession, setSoulMate, setStartRoom, setStat, setTrains, setVictim, setWimpHitPoint, setWorshipCharID, soulMate, tattoos, tell, tell, text, titledName, totalFollowers, willFollowOrdersOf
 
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.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
 
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.Contingent
amDestroyed, 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, getStat, getStatCodes, isStat, setStat
 

Field Detail

shop

protected CoffeeShop shop

whatIsSoldMask

protected long whatIsSoldMask

invResetRate

protected int invResetRate

invResetTickDown

protected int invResetTickDown

budgetRemaining

protected long budgetRemaining

budgetMax

protected long budgetMax

budgetTickDown

protected int budgetTickDown

devalueRate

protected double[] devalueRate

pricingAdjustments

protected java.lang.String[] pricingAdjustments

itemZapperMask

protected java.lang.String itemZapperMask

budget

protected Pair<java.lang.Long,TimeClock.TimePeriod> budget
Constructor Detail

StdShopKeeper

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

isSold

public boolean isSold(int mask)
Description copied from interface: ShopKeeper
Returns whether the given type of good is sold by this shopkeeper.

Specified by:
isSold in interface ShopKeeper
Parameters:
mask - the ShopKeeper DEAL_* constant describing what is sold or bought by this ShopKeeper
Returns:
true if the shopkeeper will make such a deal
See Also:
ShopKeeper.DEAL_DESCS, ShopKeeper.getWhatIsSoldMask()

addSoldType

public void addSoldType(int mask)
Description copied from interface: ShopKeeper
Adds the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper to the existing shopkeeper mask. A value of 0 will clear the whole mask.

Specified by:
addSoldType in interface ShopKeeper
Parameters:
mask - the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
See Also:
ShopKeeper.DEAL_DESCS, ShopKeeper.isSold(int)

getWhatIsSoldMask

public long getWhatIsSoldMask()
Description copied from interface: ShopKeeper
Returns the ShopKeeper DEAL_* mask describing what is sold or bought by this ShopKeeper

Specified by:
getWhatIsSoldMask in interface ShopKeeper
Returns:
the dealer type constants to the 2nd power, shifted 8 bits left
See Also:
ShopKeeper.DEAL_DESCS, ShopKeeper.setWhatIsSoldMask(long)

setWhatIsSoldMask

public void setWhatIsSoldMask(long newSellCode)
Description copied from interface: ShopKeeper
Sets the encoded ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper

Specified by:
setWhatIsSoldMask in interface ShopKeeper
Parameters:
newSellCode - the dealer type constants to the 2nd power, shifted 8 bits left
See Also:
ShopKeeper.DEAL_DESCS, ShopKeeper.addSoldType(int)

cloneFix

protected void cloneFix(MOB E)
Overrides:
cloneFix in class StdMOB

getShop

public CoffeeShop getShop()
Description copied from interface: ShopKeeper
the CoffeeShop method to access the shopkeepers store of goods

Specified by:
getShop in interface ShopKeeper
Returns:
the CoffeeShop object
See Also:
CoffeeShop

destroy

public void destroy()
Description copied from interface: Contingent
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 Contingent
Overrides:
destroy in class StdMOB

storeKeeperString

public java.lang.String storeKeeperString()
Description copied from interface: ShopKeeper
Based on the value of this ShopKeepers whatIsSold() method, this will return a displayable string describing that type.

Specified by:
storeKeeperString in interface ShopKeeper
Returns:
a description of the whatIsSold() code
See Also:
ShopKeeper.isSold(int)

doISellThis

public boolean doISellThis(Environmental thisThang)
Description copied from interface: ShopKeeper
Returns whether this ShopKeeper deals in the type of item passed in. The determination is based on the whatIsSold() code.

Specified by:
doISellThis in interface ShopKeeper
Parameters:
thisThang - the item to determine if the shopkeeper deals in
Returns:
whether the shopkeeper deals in the type of item passed in
See Also:
ShopKeeper.isSold(int)

getStartArea

protected Area getStartArea()

doInventoryReset

protected void doInventoryReset()

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 StdMOB
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

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 StdMOB
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()

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 StdMOB
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

finalPrejudiceFactors

public java.lang.String finalPrejudiceFactors()
Description copied from interface: Economics
A string describing how pricing for this ShopKeeper will differ based on customer attributes such as race.

Specified by:
finalPrejudiceFactors in interface Economics
Returns:
the string describing price prejudicing

prejudiceFactors

public java.lang.String prejudiceFactors()
Description copied from interface: Economics
A string describing how pricing for this ShopKeeper will differ based on customer attributes such as race.

Specified by:
prejudiceFactors in interface Economics
Returns:
the string describing price prejudicing

setPrejudiceFactors

public void setPrejudiceFactors(java.lang.String factors)
Description copied from interface: Economics
Sets the string describing how pricing for this ShopKeeper will differ based on customer attributes such as race.

Specified by:
setPrejudiceFactors in interface Economics
Parameters:
factors - the string describing price prejudicing

finalIgnoreMask

public java.lang.String finalIgnoreMask()
Description copied from interface: Economics
Returns the mask used to determine if a customer is ignored by the ShopKeeper.

Specified by:
finalIgnoreMask in interface Economics
Returns:
the mask used
See Also:
MaskingLibrary

ignoreMask

public java.lang.String ignoreMask()
Description copied from interface: Economics
Returns the mask used to determine if a customer is ignored by the ShopKeeper.

Specified by:
ignoreMask in interface Economics
Returns:
the mask used
See Also:
MaskingLibrary

setIgnoreMask

public void setIgnoreMask(java.lang.String factors)
Description copied from interface: Economics
Sets the mask used to determine if a customer is ignored by the ShopKeeper.

Specified by:
setIgnoreMask in interface Economics
Parameters:
factors - the mask to use
See Also:
MaskingLibrary

finalItemPricingAdjustments

public java.lang.String[] finalItemPricingAdjustments()
Description copied from interface: Economics
A string set describing how pricing for this ShopKeeper will differ based on item masks The format for each string is a floating point number followers by a space and a zapper mask

Specified by:
finalItemPricingAdjustments in interface Economics
Returns:
an array of the strings describing price adjustments

itemPricingAdjustments

public java.lang.String[] itemPricingAdjustments()
Description copied from interface: Economics
A string set describing how pricing for this ShopKeeper will differ based on item masks The format for each string is a floating point number followers by a space and a zapper mask

Specified by:
itemPricingAdjustments in interface Economics
Returns:
an array of the strings describing price adjustments

setItemPricingAdjustments

public void setItemPricingAdjustments(java.lang.String[] factors)
Description copied from interface: Economics
Sets the string set describing how pricing for this ShopKeeper will differ based on item masks The format for each string is a floating point number followers by a space and a zapper mask

Specified by:
setItemPricingAdjustments in interface Economics
Parameters:
factors - the string describing price prejudicing

finalBudget

public Pair<java.lang.Long,TimeClock.TimePeriod> finalBudget()
Description copied from interface: Economics
Returns a description of the buying budget of the shopkeeper. Format is an amount of base currency followed by HOUR,WEEK,DAY,MONTH or YEAR.

Specified by:
finalBudget in interface Economics
Returns:
the pair for the shopkeepers buying budget

budget

public java.lang.String budget()
Description copied from interface: Economics
Returns a description of the buying budget of the shopkeeper. Format is an amount of base currency followed by HOUR,WEEK,DAY,MONTH or YEAR.

Specified by:
budget in interface Economics
Returns:
the string for the shopkeepers buying budget

setBudget

public void setBudget(java.lang.String factors)
Description copied from interface: Economics
Sets a description of the buying budget of the shopkeeper. Format is an amount of base currency followed by HOUR,WEEK,DAY,MONTH or YEAR.

Specified by:
setBudget in interface Economics
Parameters:
factors - the string for the shopkeepers buying budget

finalDevalueRate

public double[] finalDevalueRate()
Description copied from interface: Economics
Returns a double array describing the percentage in the drop of the price at which this ShopKeeper will buy back items based on the number already in his inventory. The format is a number representing the percentage price drop per normal item followed by a space, followed by a number representing the percentage price drop per raw resource item. A value of null or [0,0] would mean no drop in price for either, ever.

Specified by:
finalDevalueRate in interface Economics
Returns:
null, or the price dropping percentage rule for this shopkeeper

devalueRate

public java.lang.String devalueRate()
Description copied from interface: Economics
Returns a string describing the percentage in the drop of the price at which this ShopKeeper will buy back items based on the number already in his inventory. The format is a number representing the percentage price drop per normal item followed by a space, followed by a number representing the percentage price drop per raw resource item. A value of "0 0" would mean no drop in price for either, ever.

Specified by:
devalueRate in interface Economics
Returns:
the price dropping percentage rule for this shopkeeper

setDevalueRate

public void setDevalueRate(java.lang.String factors)
Description copied from interface: Economics
Sets a string describing the percentage in the drop of the price at which this ShopKeeper will buy back items based on the number already in his inventory. The format is a number representing the percentage price drop per normal item followed by a space, followed by a number representing the percentage price drop per raw resource item. A value of "0 0" would mean no drop in price for either, ever.

Specified by:
setDevalueRate in interface Economics
Parameters:
factors - the price dropping percentage rule for this shopkeeper

finalInvResetRate

public int finalInvResetRate()
Description copied from interface: Economics
Returns the number of ticks between totally resetting this ShopKeepers inventory back to what it was.

Specified by:
finalInvResetRate in interface Economics
Returns:
the number of ticks between total resets of inventory

invResetRate

public int invResetRate()
Description copied from interface: Economics
Returns the number of ticks between totally resetting this ShopKeepers inventory back to what it was.

Specified by:
invResetRate in interface Economics
Returns:
the number of ticks between total resets of inventory

setInvResetRate

public void setInvResetRate(int ticks)
Description copied from interface: Economics
Sets the number of ticks between totally resetting this ShopKeepers inventory back to what it was.

Specified by:
setInvResetRate in interface Economics
Parameters:
ticks - the number of ticks between total resets of inventory

setWhatIsSoldZappermask

public void setWhatIsSoldZappermask(java.lang.String newSellMask)
Description copied from interface: ShopKeeper
Sets the zapper mask which applies to items to determine whether they are bought and solid by this shopkeeper.

Specified by:
setWhatIsSoldZappermask in interface ShopKeeper
Parameters:
newSellMask - the item zappermask
See Also:
ShopKeeper.isSold(int), ShopKeeper.getWhatIsSoldZappermask(), MaskingLibrary

getWhatIsSoldZappermask

public java.lang.String getWhatIsSoldZappermask()
Description copied from interface: ShopKeeper
Returns the zapper mask which applies to items to determine whether they are bought and solid by this shopkeeper.

Specified by:
getWhatIsSoldZappermask in interface ShopKeeper
Returns:
the item zappermask
See Also:
ShopKeeper.isSold(int), ShopKeeper.setWhatIsSoldZappermask(String), MaskingLibrary