[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/inherit/craft_shop_category.c</h2>
This room will handle craft shop like things, where you sell stuff to
the store and it will sell it onto other players after taking
a margin.  This can be used for potions, pottery, swords, anything!<p>Written by Pinkfish<p>Started Thu Feb  5 15:39:57 CST 1998
<h2>Inherits</h2>
This class inherits the following classes <a href="std.shops.inherit.craft_shop.c.shtml">/std/shops/inherit/craft_shop.c</a><h2>Includes</h2>
This class includes the following files /include/shops/craft_shop.h, <a href="include.money.h.shtml">/include/money.h</a> and /include/shops/bank.h<h2>Method index</h2>
<dl><ul>
<li><a href="#add_shop_category">add_shop_category</a>(string)<br/>
This method adds a category into the accept list immediately.
<li><a href="#choose_category">choose_category</a>(string, function, int, string, object *, string *)<br/>
This method chooses which category to set the item in.
<li><a href="#do_change_category">do_change_category</a>(object *, string)<li><a href="#do_list_category">do_list_category</a>(string)<br/>
This method lists a specific category of items.
<li><a href="#query_default_category">query_default_category</a>()<br/>
This method returns the current default category for the shop.
<li><a href="#query_extra_sell_check">query_extra_sell_check</a>()<br/>
This method returns the extra sell check function.
<li><a href="#query_real_category_name">query_real_category_name</a>(string)<br/>
This correctly cases the name.
<li><a href="#remove_shop_category">remove_shop_category</a>(string)<br/>
This method forcibly removes a category from the accepted list.
<li><a href="#set_category_description">set_category_description</a>(string, string)<br/>
This method sets the description of the category.
<li><a href="#set_category_information">set_category_information</a>(string, string)<br/>
This method sets the description of the category.
<li><a href="#set_default_category">set_default_category</a>(string)<br/>
This method sets the default category for the item.
<li><a href="#set_extra_sell_check">set_extra_sell_check</a>(function)<br/>
This method sets the extra sell function for the shop.
<li><a href="#setup_category">setup_category</a>(function, int, string, object *)<br/>
This method sets a category on the sellables.
<li><a href="#update_categories">update_categories</a>()<br/>
You should run this when you change the system to the category
based system.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_shop_category">
add_shop_category</a><pre>
void add_shop_category(string category)
</pre></br>
This method adds a category into the accept list immediately.  This should
really only be used for initialy setting up the shop.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the name of the category

</dl>

<ul><a name="do_change_category">
do_change_category</a><pre>
int do_change_category(object * obs,
                       string new_category)
</pre>
<ul><a name="do_list_category">
do_list_category</a><pre>
int do_list_category(string category)
</pre></br>
This method lists a specific category of items.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the category to list

</dl>

<ul><a name="query_default_category">
query_default_category</a><pre>
string query_default_category()
</pre></br>
This method returns the current default category for the shop.
<br/><ul>
<li><b>Returns:</b>
<br/>the default category

</dl>

<ul><a name="query_extra_sell_check">
query_extra_sell_check</a><pre>
function query_extra_sell_check()
</pre></br>
This method returns the extra sell check function.
<br/><ul>
<li><b>Returns:</b>
<br/>the extra sell check function
<li><b>See also:</b>
<br/><a href="#set_extra_sell_check">set_extra_sell_check()
</a></dl>

<ul><a name="query_real_category_name">
query_real_category_name</a><pre>
string query_real_category_name(string in_cat)
</pre></br>
This correctly cases the name.
<br/><ul>
<li><b>Returns:</b>
<br/>the correctly cases name, or 0 for failure

</dl>

<ul><a name="remove_shop_category">
remove_shop_category</a><pre>
void remove_shop_category(string category)
</pre></br>
This method forcibly removes a category from the accepted list.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the category to remove

</dl>

<ul><a name="set_category_description">
set_category_description</a><pre>
void set_category_description(string category,
                              string description)
</pre></br>
This method sets the description of the category.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the name of the category
<br/>description - the new description

</dl>

<ul><a name="set_category_information">
set_category_information</a><pre>
void set_category_information(string category,
                              string information)
</pre></br>
This method sets the description of the category.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the name of the category
<br/>info - the new information

</dl>

<ul><a name="set_default_category">
set_default_category</a><pre>
void set_default_category(string category)
</pre></br>
This method sets the default category for the item.  This must be setup
for something useful to happen.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the default category

</dl>

<ul><a name="set_extra_sell_check">
set_extra_sell_check</a><pre>
void set_extra_sell_check(function func)
</pre></br>
This method sets the extra sell function for the shop.  The extra sell
function is called after the sell process is almost finished.  It can
check for extra things needed in the sell process, like which page of
the book to browse.
<br/><ul>
<li><b>Parameters:</b>
<br/>func - the extra sell function
<li><b>See also:</b>
<br/><a href="#query_extra_sell_check">query_extra_sell_check()</a> and <a href="#complete_sell">complete_sell()
</a></dl>

<ul><a name="update_categories">
update_categories</a><pre>
void update_categories()
</pre></br>
You should run this when you change the system to the category
based system.  It will go through and set anything without
a category to have a category.



<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<ul><a name="choose_category">
choose_category</a><pre>
void choose_category(string category,
                     function func,
                     int value,
                     string name,
                     object * sellables,
                     string * categories)
</pre></br>
This method chooses which category to set the item in.
<br/><ul>
<li><b>Parameters:</b>
<br/>category - the category to choose
<br/>func - the function to call on exit
<br/>value - the current value of the item
<br/>name - the name of object
<br/>sellables - the items for sale

</dl>

<ul><a name="setup_category">
setup_category</a><pre>
void setup_category(function func,
                    int value,
                    string name,
                    object * sellables)
</pre></br>
This method sets a category on the sellables.  It is called from
within the craft shop code itself.
<br/><ul>
<li><b>Parameters:</b>
<br/>func - the function to call on exit
<br/>value - the current value of the item
<br/>name - the name of object
<br/>sellables - the items for sale

</dl>


[an error occurred while processing this directive]

