[Package Index | Mudlib Index | Effect Index]
Description
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.
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.
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.
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.
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:
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).
Finally, on a more cosmetic note, a shopping bag dispenser is fitted as standard. Pulling the roll dispenses a bag complete with message.
See also:
/include/player_shop.h, /std/shops/player_shop/office.c, /std/shops/player_shop/mgr_office.c, /std/shops/player_shop/counter.c, /std/shops/player_shop/shop_front.c and /std/shops/player_shop/shopkeeper.c
Written by Ringo
Started 1st August 1999
#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"); }
.
int query_num_items(string item, int cabinet)Query the current number of items in stock.
string query_office()Query the path to the office.
int query_stock(string item)Query the current stock.
void set_directions(string office, string counter, string shop)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.
void set_office(string path)Set the path of the main office.