			The Player Shop Inheritable
			   Written by Zaxan@Haven

This document details the different functions in the Player Shop
inheritable that I created. This document is divided into
many sections. Each section explains a different type of function
in the lib inheritable.

The following is the header of the body inheritable with what it
includes, inherits, and its definitions for global variables:

****************************************************************************
#include <lib.h>
#include <save.h>
#include <daemons.h>

inherit LIB_ROOM;

#include "include/player_shop.h"

mapping Meat = ([
  "Weak" : 0,
  "Medium" : 0,
  "Strong" : 0,
  ]);

mapping ShopInfo = ([ 
  "Name" : "an unowned inn",
  "Owner" : "none",
  "CurrentBidder" : "none",
  "CurrentBid" : 0,
  "Funds" : 0,
  "ShopId" : "unregistered",
  "ShopLong" : "This is a large, empty room that will someday "
               "make a fine shop of some kind. For now, it is undecorated.",
  ]);
/* ShopInfo has the following arguments:
 *  Name (string what)
 *  Owner (string who)
 *  CurrentBidder (string who)
 *  CurrentBid (int amount)
 *  Funds (int amount)
 *  ShopId (string what)
 *  ShopLong (string desc)
 */

mapping PayOut = ([ ]);
/*  Shows how much the inn is paying for corpses.
 *  In race : amount
 */

private mapping Inv = ([ ]);
/* Controls Inventory */

private string Curr = "imperials";
private int Points = 0;
private int Mad = 0;
private int WeakCost = 0;
private int MediumCost = 0;
private int StrongCost = 0;
private int barkeep = 0;
/* Miscellaneous Global Variables */
****************************************************************************

           ************************************************
                          Part 1: "The Beef"
           ************************************************

static void create();
	The good ol' create() function. Sets the generic stuff for
the shop.

void init();
	This controls the main init() of the room as well as the loading
of a barkeeper of necessary and the creation of commands for owners or
bidders.

save_object();
	All of the data of the player shops is saved in 
/save/pshops/GetShopId(). For example, if the shop had a 
SetShopId("inn_14"), the save file would be /save/pshops/inn_14.o

           ************************************************
                        Part 2: Data Functions
           ************************************************

int reset(int count);
	This is here to load a barkeeper if necessary.

int SetBarkeep(int x);
	A value of 0 here means there is no barkeeper in the inn, a value
of 1 means that there is. This controls many things such as the report and
the loading of a barkeeper in the init() and reset() functions.

int GetBarkeep();
	Returns 1 if there's a barkeeper, 0 if there is none.

int SetWeakCost(int cost); int SetMediumCost(int cost), and 
int SetStrongCost(int cost);
	These functions set the price to players that wish to buy the
weak, medium, or strong meat from the shop.

int GetWeakCost(), int GetMediumCost(), and int GetStrongCost();
	Returns the cost for the type of meat specified.

mapping SetInventory(mapping mp), mapping GetInventory(), 
mapping AddInventory(string key, mixed val), 
mapping RemoveInventory(string key), and static void LoadInventory();
	These work exactly like they do in a normal room. They are 
redefined and overridden here due to the fact that they have to be
save in the /save/pshops/ file.

int SetMad(int x);
	This sets how mad the bartender is. Negative values will cause
errors. Valid numbers are 0, 1, and 2.

int AddMad(int x);
	This adds x to the value that GetMad() returns.

int GetMad();
	This returns the number representing how mad the bartender is.
If it returns a number other than 0, 1, 2, or 3, become worried and stuff
because something's wrong.

int SetWeakMeat(int x), int SetMediumMeat(int x), and 
int SetStrongMeat(int x);
	This function sets the amount of the specified meat that the shop
has in its inventory.

int AddWeakMeat(int x), int AddMediumMeat(int x), and
int AddStrongMeat(int x);
	This function adds x to the amount of specified meat that the
shop has in its inventory.

int GetWeakMeat(), int GetMediumMeat(), and int GetStrongMeat();
	This function returns how much of the specified meat that the
shop has in its inventory.

int SetMeatPoints(int x);
	This function sets how many meat points the inn has that can be
utilized to create weak, medium, or strong meat to sell to players.

int AddMeatPoints(int x);
	This function adds to how many meat points the inn has that can be
utilized to create weak, medium, or strong meat to sell to players.

int GetMeatPoints();
	This returns how many meat points the shop has available.

string SetShopId();
	This function sets the id of the shop. It should be used in the
actual hardcoded shop.

string GetShopId();
	Returns the id of the shop. SetShopId() sets it and it should be
used in the actual hardcoded shop.

string SetOwner(string who);
	This function sets the owner of the shop. For no owner, set it
as "none". All names should be in lower case.

string GetOwner();
	This function returns the name of the owner of the inn.

string SetLocalCurrency(string curr);
	This function sets what currency the shop will be operating with.
It should be hardcoded into the shop and should never be changed. If
the curr is not a valid currency, it will be changed to "imperials".

string GetLocalCurrency();
	This function returns the currency that the shop operates with.

string SetShopName(string args);
	This sets the name of the shop that will appear in the desc
that the players see. This is basically the same as SetShort().

string GetShort(), and string GetShopName();
	These both return the name of the shop.

string SetShopDesc(string long);
	This function sets the long descript ion of the shop that players
will see. This is basically the same as SetLong().

string GetShopDesc(), and GetLong();
	These both return the long description of the shop.

string SetCurrentBidder(string who);
	This function sets who the current bidder is (the one with the
current highest bid). All names should be in lower case.

string GetCurrentBidder();
	This returns the current highest bidder on the shop. When bidding
ends, use the name that you get from here to put in SetOwner(). If you
get a "none", then nobody has bid on the shop yet and maybe you should
wait a little longer =).

int SetCurrentBid(int amount);
	This sets the current highest bid on the shop.

int GetCurrentBid();
	This returns the highest bid on the shop. This is the value that
must be beaten by other players in order to become the current bidder.

int AddStoreFunds(int amount);
	This function adds amount to the funds that the store currently
has in its account to spend.

int GetStoreFunds();
	This function returns how much money in the shop's local currency
that it has.

int SetPayOut(string race, int amount);
	This function sets the int amount that the shop will pay to a player
for a corpse of string race.

int RemovePayOut(string race);
	This will remove string race from the payouts.

int GetPayOut(string race);
	This will return the amount that the shop is paying for string
race.

mapping GetPayOuts();
	This will return all of the races and amounts that the shop has
for payouts.

mapping GetShopInfo();
	This function returns all of the goodies in SetShopInfo().

           ************************************************
                        Part 3: Action Functions
           ************************************************

int bid(string amt);
	This is the big function that controls all of the bidding of
the shop. It sets the current bidder and the current bid and makes sure
that all of the people that do not have enough money, don't sneak in a bid.

int price(string blah);
	This function is used by the owner of the inn to set how much they
want to charge for the different strengths of meat.

void ChoosePriceOption(string args), void WeakMeat(string blah),
void MediumMeat(string blah), and void StrongMeat(string blah);
	These are all used by int price() to carry out menus.

int make(string args);
	The owner of the inn uses this to make food or a barkeeper if the
shop doesn't have one.

void ChooseMakeOption(string args), void MakeBarkeeper(),
void MakeWeakFood(), void MakeMediumFood(), and void MakeStrongFood();
	These are all used by int make() to carry out menus.

int funds(string useless)
	The owner of the inn uses this to deposit money into and to
withdraw money from the inn's banking account.

void ChooseFundsOption(string args), DepositFunds(string blah), and
WithdrawFunds(string blah);
	These are all used by int funds() to carry out menus.

int remove(string args);
	An owner uses this to remove a certain race from the payouts.

int set(string args);
	The owner uses this to 'set payout for RACE to AMOUNT'. If RACE
is not a valid race, it will reject the command and whine at you, etc.

int report(string useless);
	This command creates a huge report that tells the owner everything
it needs to know such as meat points, the amount in the inventory, how
PO'd the barkeeper is, payouts, etc. It gives everything.

int setup();
	This command is used by the owner to set the Name of the inn and
the Short Description of the inn.

void ChooseSetupOption(string args), void SetupShopName(strings args), and
void SetupShopDesc(string args);
	These are all used by int setup() to carry out menus.

int command_list();
	When the owner of the inn types 'commands' or 'command' this 
function will give the owner a list of all of the possible commands that
the owner may use in the shop.

           ************************************************
                        Part 4: Example Inn
           ************************************************

Below is an example of the code of an inn. It looks simple and that's 
because it is. The inns only require a few functions while the rest is
carried out by /lib/player_shop.c and /lib/pshop_bar.c.

#include <lib.h>

inherit LIB_PLAYER_SHOP;

static void create() {
	player_shop::create();
	SetShopId("haven_inn_1");
	SetExits( ([ "out" : "/domains/haven/room/mw3" ]) );
	SetTown("Haven");
	SetLocalCurrency("imperials");
}
