[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/shops/player_shop/storeroom.c</h2>
The standard inheritable object for player-run shop storerooms.

<p><b>Description</b></p>
<p>The storeroom does not directly contain any stock, rather it acts
as an interface between the employees and the stock cabinets. A shop
may contain a varying number of cabinets between a specified minimum
and maximum level. Any cabinets above the minimum are rented for a set
fee. 
</p>
<p>This room contains functions to add items to and remove items from
the cabinets, which are assigned a particular item to store. Each
cabinet will hold a maximum number of items and the code, therefore,
has been designed to be quite flexible.
</p>
<p>In order to accommodate the _npc shopkeeper_, as well as the
newer/lazier employees, the storeroom can automatically assign items to
or retrieve items from a cabinet depending on the settings specified by
the managers. However, employees can also specify a particular cabinet
when adding/removing items or listing the stock. The actions will then
take place on that cabinet, as long as it is assigned that item. All
additions and removals to the stock are logged. 
</p>
<p>Specific products can be stored in more than one cabinet, and more
than one type of product can be stored in a single cabinet. This ensures
maximum flexibility within the stockroom.
</p>
<p>Bearing in mind that in the old model, the average size of a medium
stock file was 650k, the major benefits of multiple stock cabinets are:
<ul>
<li>Greater efficiency - A maximum of 50 objects are saved at a time,
instead of potentially several thousand.</li>
<li>Reduction in risk - Less chance that a crash will result in
catastrophic loss of stock due to data loss whilst writing.</li>
</ul></p>
<p>The cabinets are loaded only when needed, and then unloaded a set
time later.  If they are needed again during this time, the time to
unload is reset.  This means that the disk access is kept to a minumum,
whilst also conserving memory (remember, each cabinet - when full - can
take up around 50kb).
</p>
<p>Finally, on a more cosmetic note, a shopping bag dispenser is fitted
as standard. Pulling the roll dispenses a bag complete with message. 
</p>
<p><b>See also:</b><br><a href="include.player_shop.h.shtml">/include/player_shop.h</a>, <a href="std.shops.player_shop.office.c.shtml">/std/shops/player_shop/office.c</a>, <a href="std.shops.player_shop.mgr_office.c.shtml">/std/shops/player_shop/mgr_office.c</a>, <a href="std.shops.player_shop.counter.c.shtml">/std/shops/player_shop/counter.c</a>, <a href="std.shops.player_shop.shop_front.c.shtml">/std/shops/player_shop/shop_front.c</a> and <a href="std.shops.player_shop.shopkeeper.c.shtml">/std/shops/player_shop/shopkeeper.c</a><p>Written by Ringo<p>Started 1st August 1999
<h3>Example</h3>
<pre>#include "path.h"

inherit "/std/shops/player_shop/storeroom";

void setup() {
   set_light(60);
   set_directions( "north", "north", "north" );
   set_office( PATH+ "office" );

   set_short( "storeroom of Tarnach's shop" );
   set_long( "This is the storeroom of the Creel Springs branch of "
       "Tarnach Fendertwin's Quality Consumables.\n" );
   add_exit( "north", PATH+ "counter", "door");
}
</pre>
<h2>Inherits</h2>
This class inherits the following classes <a href="std.room.basic_room.c.shtml">/std/room/basic_room.c</a><h2>Includes</h2>
This class includes the following files <a href="include.move_failures.h.shtml">/include/move_failures.h</a>, <a href="include.player_shop.h.shtml">/include/player_shop.h</a> and /std/shops/player_shop/patterns.h<h2>Method index</h2>
<dl><ul>
<li><a href="#query_num_items">query_num_items</a>(string, int)<br/>
Query the current number of items in stock.
<li><a href="#query_office">query_office</a>()<br/>
Query the path to the office.
<li><a href="#query_stock">query_stock</a>(string)<br/>
Query the current stock.
<li><a href="#set_directions">set_directions</a>(string, string, string)<br/>
Set the directions to other parts of the shop.
<li><a href="#set_office">set_office</a>(string)<br/>
Set the path of the main office.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="query_num_items">
query_num_items</a><pre>
int query_num_items(string item,
                    int cabinet)
</pre></br>
Query the current number of items in stock.
<br/><ul>
<li><b>Parameters:</b>
<br/>item - The item to query.
<br/>cabinet - The cabinet to look in (0 to look at all stock).
<li><b>Returns:</b>
<br/>The number of that item in stock.

</dl>

<ul><a name="query_office">
query_office</a><pre>
string query_office()
</pre></br>
Query the path to the office.
<br/><ul>
<li><b>Returns:</b>
<br/>The path to the office.

</dl>

<ul><a name="query_stock">
query_stock</a><pre>
int query_stock(string item)
</pre></br>
Query the current stock.
<br/><ul>
<li><b>Parameters:</b>
<br/>item - The item to query.
<li><b>Returns:</b>
<br/>The amount of stock.

</dl>


<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<ul><a name="set_directions">
set_directions</a><pre>
void set_directions(string office,
                    string counter,
                    string shop)
</pre></br>
Set the directions to other parts of the shop.
This function is used by the npc shopkeeper to navigate
around the shop, using the exits at the given directions.
These directions should be the standard "north", "southeast" etc.
<br/><ul>
<li><b>Parameters:</b>
<br/>office - The direction to the office.
<br/>counter - The direction to the counter.
<br/>shop - The direction to the shop front.

</dl>

<ul><a name="set_office">
set_office</a><pre>
void set_office(string path)
</pre></br>
Set the path of the main office.
<br/><ul>
<li><b>Parameters:</b>
<br/>path - The full path & filename.

</dl>


[an error occurred while processing this directive]

