com.planet_ink.coffee_mud.core.interfaces
Interface ShopKeeper

All Superinterfaces:
java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, Economics, Environmental, Modifiable, MsgListener, StatsAffecting, Tickable
All Known Subinterfaces:
Auctioneer, Banker, Librarian, PostOffice
All Known Implementing Classes:
GenAuctioneer, GenBanker, GenLibrarian, GenPostman, GenShopkeeper, Merchant, StdAuctioneer, StdBanker, StdLibrarian, StdPostman, StdShopKeeper

public interface ShopKeeper
extends Environmental, Economics

An interface for objects capable of being a shopkeeper, usually a MOB or an Ability.


Nested Class Summary
static class ShopKeeper.ShopPrice
          This class represents a given price for a given item in the shopkeepers inventory.
 
Field Summary
static int DEAL_ALCHEMIST
          shopkeeper type constant, means they buy potions
static int DEAL_ANYTECHNOLOGY
          shopkeeper type constant, means they buy electronics items
static int DEAL_ANYTHING
          shopkeeper type constant, means they buy anything
static int DEAL_ARMOR
          shopkeeper type constant, means they buy armor
static int DEAL_AUCTIONEER
          shopkeeper type constant, means they handle auctions, and implement the Auctioneer interface
static int DEAL_BANKER
          shopkeeper type constant, means they are a banker for players, and implement the Banker interface
static int DEAL_BOOKS
          shopkeeper type constant, means they buy and sell any books
static int DEAL_BUTCHER
          shopkeeper type constant, means they buy and sell raw meats
static int DEAL_CASTER
          shopkeeper type constant, means they cast spells they sell on players
static int DEAL_CLANBANKER
          shopkeeper type constant, means they are a banker for clans, and implement the Banker interface
static int DEAL_CLANDSELLER
          shopkeeper type constant, means they buy and sell property in their area to clans
static int DEAL_CLANPOSTMAN
          shopkeeper type constant, means they handle mail for clans, and implement the Postman interface
static int[][] DEAL_CONFLICTS
          shopkeeper integer sets denoting the DEAL_* constants which conflict with each other
static int DEAL_CSHIPSELLER
          shopkeeper type constant, means they buy and sell SpaceShip areas to clans
static java.lang.String[] DEAL_DESCS
          A list of strings describing the DEAL_* constants, in their numeric value order.
static int DEAL_FOODSELLER
          shopkeeper type constant, means they buy and sell raw foodstuff
static int DEAL_GENERAL
          shopkeeper type constant, means they buy items not covered by other constants
static int DEAL_GROWER
          shopkeeper type constant, means they buy and sell raw non-meat foodstuffs
static int DEAL_HIDESELLER
          shopkeeper type constant, means they buy raw leathers and hides
static int DEAL_INNKEEPER
          shopkeeper type constant, means they sell InnKeys
static int DEAL_INSTRUMENTS
          shopkeeper type constant, means they buy and sell musical instruments
static int DEAL_INVENTORYONLY
          shopkeeper type constant, means they buy only what they are told to sell
static int DEAL_JEWELLER
          shopkeeper type constant, means they buy jewelry
static int DEAL_LANDSELLER
          shopkeeper type constant, means they buy and sell property in their area to players
static int DEAL_LEATHER
          shopkeeper type constant, means they buy leather stuff
static int DEAL_LUMBERER
          shopkeeper type constant, means they buy raw lumber
static int DEAL_MAGIC
          shopkeeper type constant, means they buy magic items
static int DEAL_METALSMITH
          shopkeeper type constant, means they buy raw metals
static int DEAL_PETS
          shopkeeper type constant, means they buy pets
static int DEAL_POSTMAN
          shopkeeper type constant, means they handle mail for players, and implement the Postman interface
static int DEAL_READABLES
          shopkeeper type constant, means they buy and sell any readables
static int DEAL_SHIPSELLER
          shopkeeper type constant, means they buy and sell SpaceShip areas to players
static int DEAL_SLAVES
          shopkeeper type constant, means they buy and sell intelligent mobs as slaves
static int DEAL_STONEYARDER
          shopkeeper type constant, means they buy raw stones
static int DEAL_TRAINER
          shopkeeper type constant, means they train players in skills they sell
static int DEAL_WEAPONS
          shopkeeper type constant, means they buy 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 addSoldType(int dealType)
          Adds the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper to the existing shopkeeper mask.
 boolean doISellThis(Environmental thisThang)
          Returns whether this ShopKeeper deals in the type of item passed in.
 CoffeeShop getShop()
          the CoffeeShop method to access the shopkeepers store of goods
 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.
 boolean isSold(int deal)
          Returns whether the given type of good is sold by this shopkeeper.
 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.
 
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

DEAL_ANYTHING

static final int DEAL_ANYTHING
shopkeeper type constant, means they buy anything

See Also:
Constant Field Values

DEAL_GENERAL

static final int DEAL_GENERAL
shopkeeper type constant, means they buy items not covered by other constants

See Also:
Constant Field Values

DEAL_ARMOR

static final int DEAL_ARMOR
shopkeeper type constant, means they buy armor

See Also:
Constant Field Values

DEAL_MAGIC

static final int DEAL_MAGIC
shopkeeper type constant, means they buy magic items

See Also:
Constant Field Values

DEAL_WEAPONS

static final int DEAL_WEAPONS
shopkeeper type constant, means they buy weapons

See Also:
Constant Field Values

DEAL_PETS

static final int DEAL_PETS
shopkeeper type constant, means they buy pets

See Also:
Constant Field Values

DEAL_LEATHER

static final int DEAL_LEATHER
shopkeeper type constant, means they buy leather stuff

See Also:
Constant Field Values

DEAL_INVENTORYONLY

static final int DEAL_INVENTORYONLY
shopkeeper type constant, means they buy only what they are told to sell

See Also:
Constant Field Values

DEAL_TRAINER

static final int DEAL_TRAINER
shopkeeper type constant, means they train players in skills they sell

See Also:
Constant Field Values

DEAL_CASTER

static final int DEAL_CASTER
shopkeeper type constant, means they cast spells they sell on players

See Also:
Constant Field Values

DEAL_JEWELLER

static final int DEAL_JEWELLER
shopkeeper type constant, means they buy jewelry

See Also:
Constant Field Values

DEAL_ALCHEMIST

static final int DEAL_ALCHEMIST
shopkeeper type constant, means they buy potions

See Also:
Constant Field Values

DEAL_BANKER

static final int DEAL_BANKER
shopkeeper type constant, means they are a banker for players, and implement the Banker interface

See Also:
Constant Field Values

DEAL_LANDSELLER

static final int DEAL_LANDSELLER
shopkeeper type constant, means they buy and sell property in their area to players

See Also:
Constant Field Values

DEAL_ANYTECHNOLOGY

static final int DEAL_ANYTECHNOLOGY
shopkeeper type constant, means they buy electronics items

See Also:
Constant Field Values

DEAL_CLANDSELLER

static final int DEAL_CLANDSELLER
shopkeeper type constant, means they buy and sell property in their area to clans

See Also:
Constant Field Values

DEAL_FOODSELLER

static final int DEAL_FOODSELLER
shopkeeper type constant, means they buy and sell raw foodstuff

See Also:
Constant Field Values

DEAL_BUTCHER

static final int DEAL_BUTCHER
shopkeeper type constant, means they buy and sell raw meats

See Also:
Constant Field Values

DEAL_GROWER

static final int DEAL_GROWER
shopkeeper type constant, means they buy and sell raw non-meat foodstuffs

See Also:
Constant Field Values

DEAL_HIDESELLER

static final int DEAL_HIDESELLER
shopkeeper type constant, means they buy raw leathers and hides

See Also:
Constant Field Values

DEAL_LUMBERER

static final int DEAL_LUMBERER
shopkeeper type constant, means they buy raw lumber

See Also:
Constant Field Values

DEAL_METALSMITH

static final int DEAL_METALSMITH
shopkeeper type constant, means they buy raw metals

See Also:
Constant Field Values

DEAL_STONEYARDER

static final int DEAL_STONEYARDER
shopkeeper type constant, means they buy raw stones

See Also:
Constant Field Values

DEAL_CLANBANKER

static final int DEAL_CLANBANKER
shopkeeper type constant, means they are a banker for clans, and implement the Banker interface

See Also:
Constant Field Values

DEAL_INNKEEPER

static final int DEAL_INNKEEPER
shopkeeper type constant, means they sell InnKeys

See Also:
Constant Field Values

DEAL_SHIPSELLER

static final int DEAL_SHIPSELLER
shopkeeper type constant, means they buy and sell SpaceShip areas to players

See Also:
Constant Field Values

DEAL_CSHIPSELLER

static final int DEAL_CSHIPSELLER
shopkeeper type constant, means they buy and sell SpaceShip areas to clans

See Also:
Constant Field Values

DEAL_SLAVES

static final int DEAL_SLAVES
shopkeeper type constant, means they buy and sell intelligent mobs as slaves

See Also:
Constant Field Values

DEAL_POSTMAN

static final int DEAL_POSTMAN
shopkeeper type constant, means they handle mail for players, and implement the Postman interface

See Also:
Constant Field Values

DEAL_CLANPOSTMAN

static final int DEAL_CLANPOSTMAN
shopkeeper type constant, means they handle mail for clans, and implement the Postman interface

See Also:
Constant Field Values

DEAL_AUCTIONEER

static final int DEAL_AUCTIONEER
shopkeeper type constant, means they handle auctions, and implement the Auctioneer interface

See Also:
Constant Field Values

DEAL_INSTRUMENTS

static final int DEAL_INSTRUMENTS
shopkeeper type constant, means they buy and sell musical instruments

See Also:
Constant Field Values

DEAL_BOOKS

static final int DEAL_BOOKS
shopkeeper type constant, means they buy and sell any books

See Also:
Constant Field Values

DEAL_READABLES

static final int DEAL_READABLES
shopkeeper type constant, means they buy and sell any readables

See Also:
Constant Field Values

DEAL_CONFLICTS

static final int[][] DEAL_CONFLICTS
shopkeeper integer sets denoting the DEAL_* constants which conflict with each other


DEAL_DESCS

static final java.lang.String[] DEAL_DESCS
A list of strings describing the DEAL_* constants, in their numeric value order.

Method Detail

getShop

CoffeeShop getShop()
the CoffeeShop method to access the shopkeepers store of goods

Returns:
the CoffeeShop object
See Also:
CoffeeShop

getWhatIsSoldMask

long getWhatIsSoldMask()
Returns the ShopKeeper DEAL_* mask describing what is sold or bought by this ShopKeeper

Returns:
the dealer type constants to the 2nd power, shifted 8 bits left
See Also:
DEAL_DESCS, setWhatIsSoldMask(long)

isSold

boolean isSold(int deal)
Returns whether the given type of good is sold by this shopkeeper.

Parameters:
deal - 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:
DEAL_DESCS, getWhatIsSoldMask()

setWhatIsSoldMask

void setWhatIsSoldMask(long newSellCode)
Sets the encoded ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper

Parameters:
newSellCode - the dealer type constants to the 2nd power, shifted 8 bits left
See Also:
DEAL_DESCS, addSoldType(int)

addSoldType

void addSoldType(int dealType)
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.

Parameters:
dealType - the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
See Also:
DEAL_DESCS, isSold(int)

storeKeeperString

java.lang.String storeKeeperString()
Based on the value of this ShopKeepers whatIsSold() method, this will return a displayable string describing that type.

Returns:
a description of the whatIsSold() code
See Also:
isSold(int)

doISellThis

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

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:
isSold(int)

setWhatIsSoldZappermask

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.

Parameters:
newSellMask - the item zappermask
See Also:
isSold(int), getWhatIsSoldZappermask(), MaskingLibrary

getWhatIsSoldZappermask

java.lang.String getWhatIsSoldZappermask()
Returns the zapper mask which applies to items to determine whether they are bought and solid by this shopkeeper.

Returns:
the item zappermask
See Also:
isSold(int), setWhatIsSoldZappermask(String), MaskingLibrary