[Package Index | Mudlib Index | Effect Index]

File /std/shops/player_shop/storeroom.c

The standard inheritable object for player-run shop storerooms.

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

Example

#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");
}

Inherits

This class inherits the following classes /std/room/basic_room.c

Includes

This class includes the following files /include/move_failures.h, /include/player_shop.h and /std/shops/player_shop/patterns.h

Method index

Public Functions

These are functions that everyone can access.

.