|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CoffeeShop
A CoffeeShop is an object for storing the inventory of a shopkeeper, banker, auctionhouse, merchant, or other object that implements the ShopKeeper interface for the purpose of selling goods and services. ShopKeepers maintain two types of inventory, the base inventory, and the stock inventory. The stock or store inventory is the list of items the shopkeeper currently has for sale, the amounts, base prices, etc. The base inventory is used only for shopkeepers who only buy things like they originally had in stock, and so the base inventory is always populated with a single copy of the original store inventory, to be used as a base of comparison for situations where the stock is empty, but someone is wanting to sell.
ShopKeeper,
ShopKeeper.isSold(int),
ShopKeeper.DEAL_INVENTORYONLY| Nested Class Summary | |
|---|---|
static class |
CoffeeShop.ShelfProduct
Class for representing a shelf product, holding an item prototype, the number in stock, and the price. |
| Method Summary | |
|---|---|
Environmental |
addStoreInventory(Environmental thisThang)
Adds a new item to the store inventory. |
Environmental |
addStoreInventory(Environmental thisThang,
int number,
int price)
Adds a new item to the store inventory so the shopkeeper can sell it. |
CoffeeShop |
build(ShopKeeper SK)
Initializes this shop object with its host ShopKeeper |
void |
buildShopFromXML(java.lang.String text)
Repopulates this shop inventory from a given xml document, restoring store inventory, base inventory, prices, and availability. |
void |
delAllStoreInventory(Environmental thisThang)
Removes all items like the given item from the base and store inventory. |
boolean |
doIHaveThisInStock(java.lang.String name,
MOB mob)
Returns whether an item with the given name is presently in this stores stock inventory, and available for sale. |
void |
emptyAllShelves()
Clears both the base and stock/store inventories. |
int |
enumerableStockSize()
Returns the number of items in the stores base inventory. |
java.util.Iterator<Environmental> |
getEnumerableInventory()
Returns a Vector of all the Environmental objects this shop has in its base inventory. |
Environmental |
getStock(java.lang.String name,
MOB mob)
Searches this shops stock of items for sale for one matching the given name. |
java.util.Iterator<Environmental> |
getStoreInventory()
Returns a Vector of all the Environmental objects this shop has for sale. |
java.util.Iterator<Environmental> |
getStoreInventory(java.lang.String srchStr)
Returns a Vector of all the Environmental objects this shop has for sale which match the given search string. |
boolean |
inEnumerableInventory(Environmental thisThang)
Returns whether an item sufficiently like the given item originally existed in this shops inventory when it was created. |
boolean |
isSold(int code)
Returns whether the whatIsSold code applies to the shopkeeper hosting this shop. |
java.lang.String |
makeXML()
Generates an XML document of all available shop inventory, prices, and availability. |
int |
numberInStock(Environmental likeThis)
Returns the number of items like the one given that the shopkeeper presently has in stock and available for sale. |
java.util.List<Environmental> |
removeSellableProduct(java.lang.String named,
MOB mob)
Searches this shops stock of items for sale for one matching the given name. |
Environmental |
removeStock(java.lang.String name,
MOB mob)
Searches this shops stock of items for sale for one matching the given name. |
void |
resubmitInventory(java.util.List<Environmental> shopItems)
A method for quickly making wholesale changes to a shopkeepers inventory. |
ShopKeeper |
shopKeeper()
Returns the shopKeeper that is hosting this shop |
int |
stockPrice(Environmental likeThis)
Returns the base stock price (not the final price by any means) that the shop will use as a foundation for determining the given items price. |
int |
totalStockSize()
Returns the number of items this shop currently has for sale. |
int |
totalStockSizeIncludingDuplicates()
The number of items in the store inventory, taking number in stock into account. |
int |
totalStockWeight()
Total weight, in pounds, of all items in the store inventory, taking number in stock into account. |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, ID, initializeClass, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Method Detail |
|---|
boolean inEnumerableInventory(Environmental thisThang)
thisThang - the thing to compare against the base inventory
ShopKeeper.isSold(int),
ShopKeeper.DEAL_INVENTORYONLYEnvironmental addStoreInventory(Environmental thisThang)
thisThang - the thing to sell
addStoreInventory(Environmental, int, int)int enumerableStockSize()
ShopKeeper.isSold(int),
ShopKeeper.DEAL_INVENTORYONLYint totalStockSize()
totalStockSizeIncludingDuplicates()java.util.Iterator<Environmental> getStoreInventory()
java.util.Iterator<Environmental> getStoreInventory(java.lang.String srchStr)
srchStr - the item to hunt for.
java.util.Iterator<Environmental> getEnumerableInventory()
ShopKeeper.isSold(int),
ShopKeeper.DEAL_INVENTORYONLYvoid emptyAllShelves()
Environmental addStoreInventory(Environmental thisThang,
int number,
int price)
thisThang - the item/mob/ability to sellnumber - the number of items to sellprice - the price of the item (in base currency) or -1 to have it determined
int totalStockWeight()
int totalStockSizeIncludingDuplicates()
totalStockSize()void delAllStoreInventory(Environmental thisThang)
thisThang - the item like which to removeShopKeeper.isSold(int)
boolean doIHaveThisInStock(java.lang.String name,
MOB mob)
name - the name of the item to search formob - the mob who is interested (stock can differ depending on customer)
ShopKeeper.isSold(int)int stockPrice(Environmental likeThis)
likeThis - the item like which to compare
getStoreInventory()int numberInStock(Environmental likeThis)
likeThis - the item like which to compare
getStoreInventory()
Environmental getStock(java.lang.String name,
MOB mob)
name - the name of the item to search formob - the mob who is interested (stock can differ depending on customer)
getStoreInventory()
Environmental removeStock(java.lang.String name,
MOB mob)
name - the name of the item to search formob - the mob who is interested (stock can differ depending on customer)
getStoreInventory()
java.util.List<Environmental> removeSellableProduct(java.lang.String named,
MOB mob)
named - the name of the item to search formob - the mob who is interested (stock can differ depending on customer)
getStoreInventory()java.lang.String makeXML()
getStoreInventory(),
buildShopFromXML(String)void buildShopFromXML(java.lang.String text)
text - the xml document to restore frommakeXML()void resubmitInventory(java.util.List<Environmental> shopItems)
shopItems - the items for inventoryCoffeeShop build(ShopKeeper SK)
SK - the shopkeeper that hosts this object
ShopKeeper shopKeeper()
boolean isSold(int code)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||