Home

[Package Index | Mudlib Index | Effect Index]

File /std/shops/player_shop/counter.c

The standard inheritable object for player-run shop counters.

Description

The area behind the counter is the location of the sales log and the cash register. It is also fitted as standard with a basic calculator for those mathematically-challenged employees.

The register holds the shop's float. Employees can put money in, or get money from the register as with any other container, and all additions and removals are logged.

The shop's log allows employees to log a sale or purchase to verify the actions they have taken. This allows managers and supervisors to confirm that employees are not taking advantage of the shop as all stock movements, register adjustments and log entries should match up.

See also:
/include/player_shop.h, /std/shops/player_shop/office.c, /std/shops/player_shop/mgr_office.c, /std/shops/player_shop/storeroom.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/counter";

void setup()
{
   set_light(60);
   set_office( PATH+ "office" );
   set_directions( "west", "south", "east" );

   set_short( "behind the counter of Tarnach's shop" );
   set_long( "This is the area behind the counter of the Creel Springs "
      "branch of Tarnach Fendertwin's Quality Consumables.\n" );
   add_exit( "south", PATH + "storeroom", "door" );
   add_exit( "east", PATH + "front", "path" );
   add_exit( "west", PATH + "office", "door" );
}

Inherits

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

Includes

This class includes the following files /include/shops/bank.h, /include/money.h and /include/player_shop.h

Method index

  • query_register()
    Query the value of the register's contents.
  • set_directions(string, string, string)
    Set the directions to other parts of the shop.
  • set_office(string)
    Set the path of the main office.

Public Functions

These are functions that everyone can access.

.

    query_register
    int query_register()
    

    Query the value of the register's contents.
    • Returns:
      the current value of the register's contents

Protected Functions

These are functions that only objects inheriting the class can access.

    set_directions
    void set_directions(string office,
                        string storeroom,
                        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.
    • Parameters:
      office - The direction to the office.
      storeroom - The direction to the store room.
      shop - The direction to the shop front.
    • Example:
      set_directions( "west", "south", "east" );
      
      
        set_office
        void set_office(string path)
        

        Set the path of the main office. Also sets up the and restores the register.
        • Parameters:
          path - The full path & filename to the office.
        • Example:
          set_office( PATH + "tarnach's_office" );
Valid HTML 4.01 Transitional
Valid CSS!
Read More