<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Discworld MUD</title>
    <link href="/external/includes/style.css" rel="stylesheet" type="text/css">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <table border="0" width="95%">
        <tr>
          <td style="width:125px">
            <a href="/lpc/index.html"><img src="/external/images/logo_turtle.gif" style="border-style:none" alt="Home" width="110" height="106"></a>
          </td>
          <td valign="top">
            <br>
            <br>
            <script type="text/javascript" src="/external/includes/discworld.js"></script>
            <div id="textnav" style="visibility:hidden;position:absolute;">
              <a href="/lpc/about/">About</a>  | <a href="/lpc/playing/">Playing</a>  | <a href="/lpc/~Playtesters/">Playtesting</a>  | <a href="/lpc/creating/">Creating</a>  | <a href="/lpc/links/">Links</a> 
              <!--%textsubmenu%-->
            </div>
          </td>
        </tr>
        <tr>
          <td valign="top" style="width:125px">
            <!--%login%-->
          <p style="text-align:center" class="menu"><a href="javascript:popup('/external/java/newtelnet/java_client.shtml','JavaClient', 'width=800,height=600,resizable=yes,scrollbar=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')">Play Now</a></p>

          </td>
          <td valign="top">


[<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 /obj/handlers/wizard_orders.c</h2>
Each element of wizard_details contains the details for the
corresponding wizard.  These details are:

    wizard's level, a number from 0 to 8
    wizard's time of advancement, a number
    wizard's rating, a number

This will initialize the variables in the handler and tidy the
orders<p><b>See also:</b><br>tidy_order
.c<h2>Inherits</h2>
This class inherits the following classes <a href="std.object.c.shtml">/std/object.c</a><h2>Method index</h2>
<dl><ul>
<li><a href="#add_wizard">add_wizard</a>(string, string)<br/>
Add a wizard to an order.
<li><a href="#fill_vacancies">fill_vacancies</a>(string)<br/>
This will fill the spaces cleaned out by the cleanup functions.
<li><a href="#find_wizard">find_wizard</a>(string)<br/>
This function will find any wizard regardless of which order they are in.
<li><a href="#get_data_file">get_data_file</a>(string)<br/>
Checks to see if the order entered is a valid order.
<li><a href="#init_data">init_data</a>(string)<br/>
Called by get_data_file
resets the values of wizard_details and clears the cache of
wizards remembered to make typing 'who wizards' less memory
intensive.
<li><a href="#query_capacities">query_capacities</a>(string)<br/>
List how many spots are availible for wizards to occupy in a
given order.
<li><a href="#query_capacity">query_capacity</a>(string, int)<br/>
List how many spots are availible for wizards to occupy in a given
order, at a given level.
<li><a href="#query_occupancies">query_occupancies</a>(string)<br/>
This method returns the number of wizards at each level in a given order

<li><a href="#query_occupiers">query_occupiers</a>(string, int)<br/>
This method returns the wizards by name at the specified level in a given
order.
<li><a href="#query_order_name">query_order_name</a>(string)<br/>
Function to find out the full name of an order.
<li><a href="#query_order_room">query_order_room</a>(string)<br/>
An order can have a room that is informed when a wizard is promoted or
demoted.
<li><a href="#query_orders">query_orders</a>()<br/>
List all the orders.
<li><a href="#query_wizard_details">query_wizard_details</a>(string)<br/>
Displays the contents of the wizard_details array.
<li><a href="#query_wizard_level">query_wizard_level</a>(string, string)<br/>
Returns the wizard's order level if you know the order and the wizard

<li><a href="#query_wizard_rating">query_wizard_rating</a>(string, string)<br/>
Returns the wizard's rating with the order and the wizard

<li><a href="#query_wizard_time">query_wizard_time</a>(string, string)<br/>
Returns the time at which the wizard last died or was demoted.
<li><a href="#query_wizards">query_wizards</a>(string)<br/>
Lists all the wizards in an order.
<li><a href="#remove_wizard">remove_wizard</a>(string, string)<br/>
Remove a wizard from an order.
<li><a href="#save_data_file">save_data_file</a>(string)<br/>
Saves the data file for the order.
<li><a href="#set_capacity">set_capacity</a>(string, int, int)<br/>
Change the number of spots availible for wizards to occupy in a given
order.
<li><a href="#set_order_name">set_order_name</a>(string, string)<br/>
Set the full name of the order.
<li><a href="#set_order_room">set_order_room</a>(string, string)<br/>
Set the orders room.
<li><a href="#set_wizard_rating">set_wizard_rating</a>(string, string, int)<br/>
Set the rating of a given wizard.
<li><a href="#tidy_order">tidy_order</a>(string, int)<br/>
This function is called by create() to tidy the order.
<li><a href="#wizard_died">wizard_died</a>(string, string)<br/>
Clean up function!
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_wizard">
add_wizard</a><pre>
int add_wizard(string order,
               string wizard)
</pre></br>
Add a wizard to an order.  This will not add a wizard to the guild.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>wizard - the wizard's name

<li><b>Returns:</b>
<br/>0 on failure, 1 on success.

</dl>

<ul><a name="fill_vacancies">
fill_vacancies</a><pre>
void fill_vacancies(string order)
</pre></br>
This will fill the spaces cleaned out by the cleanup functions. It will
move the array of wizards upwards to fill the empty spots and place those
who were on the top on the bottom of the list.

occupancies is an array of the number of spots available in the given order

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>See also:</b>
<br/>query_occupancies
.c</dl>

<ul><a name="find_wizard">
find_wizard</a><pre>
mixed * find_wizard(string wizard)
</pre></br>
This function will find any wizard regardless of which order they are in.
It is an expensive function since it may have to check many orders and hence
load several data files. It is used by the wizards guild object to find a
wizard who was once inactive but who has returned ie. it's called fairly
infrequently.

<br/><ul>
<li><b>Parameters:</b>
<br/>wizard - The name of a wizard
<li><b>Returns:</b>
<br/>a mixed array of the wizards order and level in the order

</dl>

<ul><a name="get_data_file">
get_data_file</a><pre>
int get_data_file(string order)
</pre></br>
Checks to see if the order entered is a valid order.
If not, writes an error to the log file. If it is a
valid order, the order's data file is loaded.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - short form of the order name
Valid entries are:
  "silver_star",
  "venerable_seers",
  "unbroken_circle",
  "djinn_diviners",
  "scintillating_scarab",
  "dynastic_crescent",


</dl>

<ul><a name="init_data">
init_data</a><pre>
void init_data(string order)
</pre></br>
Called by get_data_file
resets the values of wizard_details and clears the cache of
wizards remembered to make typing 'who wizards' less memory
intensive.

Each element of wizard_details contains the details for the
corresponding wizard.  These details are:

    wizard's level, a number from 0 to 8
    wizard's time of advancement, a number
    wizard's rating, a number

<br/><ul>
<li><b>Parameters:</b>
<br/>order - Short form of the order name
Valid entries are:
  "silver_star",
  "venerable_seers",
  "unbroken_circle",
  "djinn_diviners",
  "scintillating_scarab",
  "dynastic_crescent",

</dl>

<ul><a name="query_capacities">
query_capacities</a><pre>
int * query_capacities(string order)
</pre></br>
List how many spots are availible for wizards to occupy in a
given order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>Returns:</b>
<br/>capacities array of capacities wizards level 8-4 decending.

</dl>

<ul><a name="query_capacity">
query_capacity</a><pre>
int query_capacity(string order,
                   int which)
</pre></br>
List how many spots are availible for wizards to occupy in a given
order, at a given level.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>which - The level to return the capacity for.
<li><b>Returns:</b>
<br/>int the number of spots at that level.


</dl>

<ul><a name="query_occupancies">
query_occupancies</a><pre>
int * query_occupancies(string order)
</pre></br>
This method returns the number of wizards at each level in a given order

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>Returns:</b>
<br/>an array of integers containing the number of wizards at each level.

</dl>

<ul><a name="query_occupiers">
query_occupiers</a><pre>
string * query_occupiers(string order,
                         int level)
</pre></br>
This method returns the wizards by name at the specified level in a given
order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>level - the order level ( 4-8 ) in question.
<li><b>Returns:</b>
<br/>string * an array of the occupiers.

</dl>

<ul><a name="query_order_name">
query_order_name</a><pre>
string query_order_name(string order)
</pre></br>
Function to find out the full name of an order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>Returns:</b>
<br/>Full name of the order

</dl>

<ul><a name="query_order_room">
query_order_room</a><pre>
string query_order_room(string order)
</pre></br>
An order can have a room that is informed when a wizard is promoted or
demoted. This function returns the filename of that room if there is one.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>Returns:</b>
<br/>string the filename of the order room.

</dl>

<ul><a name="query_orders">
query_orders</a><pre>
string * query_orders()
</pre></br>
List all the orders.

<br/><ul>
<li><b>Returns:</b>
<br/>string* a list of the current orders.

</dl>

<ul><a name="query_wizard_details">
query_wizard_details</a><pre>
mixed * query_wizard_details(string order)
</pre></br>
Displays the contents of the wizard_details array.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>Returns:</b>
<br/>wizard_details an array of wizard details

<li><b>See also:</b>
<br/>get data file.c and create
.c</dl>

<ul><a name="query_wizard_level">
query_wizard_level</a><pre>
int query_wizard_level(string order,
                       string wizard)
</pre></br>
Returns the wizard's order level if you know the order and the wizard

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name
<br/>wizard - the wizard's name
<li><b>Returns:</b>
<br/>int the level of that wizard.

</dl>

<ul><a name="query_wizard_rating">
query_wizard_rating</a><pre>
int query_wizard_rating(string order,
                        string wizard)
</pre></br>
Returns the wizard's rating with the order and the wizard

<br/><ul>
<li><b>Parameters:</b>
<br/>order - short form of the order name
<br/>wizard - the wizard's name.
<li><b>Returns:</b>
<br/>the wizard's rating.

</dl>

<ul><a name="query_wizard_time">
query_wizard_time</a><pre>
int query_wizard_time(string order,
                      string wizard)
</pre></br>
Returns the time at which the wizard last died or was demoted.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name
<br/>wizard - the name of the wizard.
<li><b>Returns:</b>
<br/>int the time.

</dl>

<ul><a name="query_wizards">
query_wizards</a><pre>
string * query_wizards(string order)
</pre></br>
Lists all the wizards in an order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<li><b>Returns:</b>
<br/>string array of all the wizards in the order.
<li><b>See also:</b>
<br/>get_data_file
.c</dl>

<ul><a name="remove_wizard">
remove_wizard</a><pre>
int remove_wizard(string order,
                  string wizard)
</pre></br>
Remove a wizard from an order.  This will be called by cleanup also
This will happen if the player refreshes, gets deleted, etc.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>wizard - the wizard's name

<li><b>Returns:</b>
<br/>0 on failure, 1 on success.

<li><b>See also:</b>
<br/>get_data_file.c</dl>

<ul><a name="save_data_file">
save_data_file</a><pre>
void save_data_file(string order)
</pre></br>
Saves the data file for the order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.

<li><b>See also:</b>
<br/>get_data_file
.c</dl>

<ul><a name="set_capacity">
set_capacity</a><pre>
void set_capacity(string order,
                  int which,
                  int number)
</pre></br>
Change the number of spots availible for wizards to occupy in a given
order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>which - the level to set the capacity for.
<br/>number - the number of spots.

</dl>

<ul><a name="set_order_name">
set_order_name</a><pre>
void set_order_name(string order,
                    string new_full_name)
</pre></br>
Set the full name of the order.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>new_full_name - the new full name of the order.
<li><b>Example:</b>
<br/><pre>set_order_name("silver_star", "the Brothers of the Silver Star");
</pre></dl>

<ul><a name="set_order_room">
set_order_room</a><pre>
void set_order_room(string order,
                    string new_order_room)
</pre></br>
Set the orders room.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name.
<br/>new_order_room - the filename of the new order room

<li><b>See also:</b>
<br/>query_order_room
.c</dl>

<ul><a name="set_wizard_rating">
set_wizard_rating</a><pre>
void set_wizard_rating(string order,
                       string wizard,
                       int rating)
</pre></br>
Set the rating of a given wizard.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - short form of the order name
<br/>wizard - the wizard's name.
<br/>the - wizard's new rating.

</dl>

<ul><a name="tidy_order">
tidy_order</a><pre>
void tidy_order(string order,
                int i)
</pre></br>
This function is called by create() to tidy the order. It calls itself on
a delayed callout gradually working through each wizard in each order and
demoting those that need demoting.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the order currently being tidied
<br/>i - the index in the order's array of which wizard to look at next.

</dl>

<ul><a name="wizard_died">
wizard_died</a><pre>
void wizard_died(string order,
                 string wizard)
</pre></br>
Clean up function!

Demotes the wizard at death, for inactivity, removes them if they're
no longer wizards, or have become creators. Writes errors to the log file.

Contains debugging tools.

<br/><ul>
<li><b>Parameters:</b>
<br/>order - the short form of the order name
<br/>wizard - the wizard's name


</dl>


</td>
</tr>
<tr>
<td valign="bottom" align="center">
<table>
<tr>
<td align="center" class="imgcell">
<a href="http://validator.w3.org/check?uri=referer"><img src="/external/images/valid-html401" alt="Valid HTML 4.01 Transitional" height=31 width=88 border=0></a>
</td>
</tr>
<tr>
<td align="center" class="imgcell">
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img height="31" width="88" style="border-style:none" src="/external/images/vcss" alt="Valid CSS!"></a>
</td>
</tr>
<tr>
<td align="center">
<a href="/lpc/html_css.html" style="font-size:smaller">Read More</a>
</td>
</tr>
</table>
</td>
<td align="left" valign="top">
<h3></h3>
<p class="copyright">Brought to you by CMOT Dibbler's <a href="/lpc/sausages.html">Sensational Sausages</a>; buy one while they're hot.<br>
Copyright &copy; Discworld MUD, <a href="javascript:popup('/external/java/newtelnet/java_client.shtml','JavaClient', 'width=800,height=600,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')">Play Now</a>, <a href="http://www.topmudsites.com/cgi-bin/topmuds/rankem.cgi?action=in&amp;id=pinkfish" rel="external">Vote</a>.</p>
</td>
</tr>
</table>
</body>
</html>

