|
|
[Package Index | Mudlib Index | Effect Index]
File /std/shops/controllers/craft_shop_controller.c
This is to handle a place where players can sell a number of neato
craft items they have made up. It will be extended to deal with
books as well.
It keeps track of who sold each item and how much they will
receive when they pay for it. Then tracks the royalties so
they can come back and collect them.
This will be run as a handler object so that npcs and rooms can
both run as this sort of shop.
NB: This object is not saved using save_object. You need to set the
save and load functions for this system to work. Written by Pinkfish Started Thu Feb 5 15:39:57 CST 1998
Includes
This class includes the following files /include/playtesters.h, /include/shops/craft_shop.h, /include/move_failures.h, /include/money.h, /include/shops/bank.h, /include/player.h and /include/obj_parser.hClass Index
Method index
- add_category_accepted(string)
This method adds a category and sets it as already being accepted.
- add_category_request(string, object, int)
Add a request for a new category.
- add_list_object(object, string, int, string, string, int)
This will allow us to add an object into the inventory of the
craft shop.
- add_to_sellables(string, string, class craft_object *)
This method adds a selable into the current sellable array.
- adjust_royalty(string, int)
This method adjusts the current royalties for the player.
- buy_objects(object *, string, int, string, string, int)
This method will buy the specified objects and place them into our
current potential sell list.
- change_category_of_shop_object(object, string)
This method changes the category of the shop object.
- change_name_of_shop_object(object, string, int)
This method changes the name of the shop object.
- change_value_of_shop_object(object, int)
This method changes the value of the shop object.
- create_all_real_objects(object, object *)
This method creates real objects for all the passed in dummy objects.
- create_auto_load_file(mixed, int)
This method creates a save file for the specified objects autoloading
capability.
- create_craft_object(object, string, int, string)
This method creates a craft object from the input actual object.
- create_craft_sellable()
This method creates a sellable class.
- create_dummy_object(string, string, int, class craft_object)
This method creates a dummy object for use when selling items.
- create_real_auto_load_object(int, object)
This method creates a real object from the save file number.
- create_real_object(object, class craft_object)
This method turns a craft_object class into an actual object.
- delete_objects(string)
This method deletes the specified list entry.
- find_matching_objects(string)
This method finds the objects which matched the passed in pattern.
- find_shop_object(class craft_object)
This method figured out what the real object is for the class.
- has_voted_for_category(string, object)
This method checks to see if the player has voted (or nominated) for a
specified category already.
- is_valid_category(string)
This method checks to make sure that the category is valid.
- load_it()
This method loads the current state of the system.
- pay_out_royalty(string, string, int)
This method pays out the royalties owed to the specified player.
- query_all_royalties()
This method returns the royalty mapping on the object.
- query_categories()
This method returns the list of categories for the current shop.
- query_category_description(string)
This method returns the category description.
- query_category_information(string)
This method returns the category information.
- query_category_of(string, string)
This method returns the category associated with this name/category
set.
- query_category_of_shop_object(object)
This method returns the category of the speficied shop object.
- query_category_timeout(string)
This method returns the time the current category has left before it
times out.
- query_class_of_shop_object(object)
This method searches the current sell list to see if the object
passed corresponds to any of the existing things in our
sell list.
- query_dont_use_name()
This method is used to determine the status of the flag which controls
adding the owners name to shop objects by default.
- query_id_of_shop_object(object)
This method returns the id associated with the shop object.
- query_items_with_shop_id(string)
This method returns all the objects which match the specified
id of the shop object.
- query_list_object_cost(string, string)
This method returns the cost of the specified type of object.
- query_name_of_shop_object(object)
This method returns the list name associated with the shop
object.
- query_next_shop_id()
This method attempts to figure out what the next id would
be for the object.
- query_owner_of_shop_object(object)
This method returns the owner associated with the shop
object.
- query_owner_sellables(string)
This method returns the list of sellables that the owner currently
has in the shop.
- query_royalty(string)
This method returns the current royalties for the specified person.
- query_sell_list()
This method returns the container associated with the sell list.
- query_sell_list_obs()
This method returns all the current objects in the sell list.
- query_short_of_shop_object(object)
This method returns the possible short descriptions of the shop objects.
- remove_auto_load_file(int)
This method removes the auto load stuff after it is no longer needed.
- remove_category_accepted(string)
This method removes a category immediately.
- remove_list_object(string, string, class craft_object)
This method removes a single object from the current object list.
- remove_shop_id(string)
This method removes an id when that book has been taken from the
shop.
- remove_shop_object(object)
This method removes the real data behind the specified shop object.
- save_it()
This method saves the current state of the system.
- sell_objects(object *, string, object, int, int, int ref)
This method sells the specified shop objects to the player.
- set_category_description(string, string)
This method sets the description of the category.
- set_category_function(function)
This method is called when categories complete each of their phases to
see if the idea was passed by enough majority or whatever to go onto
the next one.
- set_category_information(string, string)
This method sets the information of the category.
- set_dont_use_name(int)
This method is called by the controled object onto here to control
if the owners name is added to shop objects.
- set_id_of_shop_objects(object *, string)
This method sets the current id of the shop objects.
- set_load_function(function)
This method sets the load function on the class.
- set_save_function(function)
This method sets the save function on the class.
- update_craft_object(object, object)
This method updates the internal representation of the specified
craft object.
- value_of_objects(object *)
This method determines the price of all the shop objects in the
array.
- vote_for_category(string, object, int)
This method allows the player to vote for the specified category.
Public Functions
These are functions that everyone can access.
.
int add_category_accepted(string name)
This method adds a category and sets it as already being accepted.
- Parameters:
name - the name of the category to add
int add_category_request(string name,
object player,
int timeout)
Add a request for a new category.
- Parameters:
name - the name of the category
player - the person who suggested it
timeout - the initial timeout for the nomination period
- Returns:
1 if successful added, 0 if not
int add_list_object(object ob,
string name,
int cost,
string owner,
string category,
int dont_update_cost)
This will allow us to add an object into the inventory of the
craft shop. If the name already exists in the inventory we
just increment the number left by the number passed in here.
If the number left goes below 0 then the item is remove
from the inventory.
|