[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 /obj/handlers/inherit/citizens.c</h2>
This handler keeps track of citizenships and magistrates.<p>Written by Pinkfish <p>Started Fri Jun 23 20:38:10 PDT 2000
<h2>Includes</h2>
This class includes the following files /include/refresh.h, /include/player_handler.h, /include/playtesters.h and /include/player.h<h2>Method index</h2>
<ul>
<li><a href="#add_citizen">add_citizen</a>(string, string)<br/>
This method adds a citizen to the specified area.
<li><a href="#add_magistrate">add_magistrate</a>(string, string)<br/>
This method adds a magistrate to the area.
<li><a href="#create_area">create_area</a>(string, int)<br/>
This method creates an area for citizens to womble in.
<li><a href="#is_citizen_of">is_citizen_of</a>(string, string)<br/>
This method checks to see if the specified person is a citizen or
not.
<li><a href="#is_magistrate">is_magistrate</a>(string)<br/>
This method determines if someone is a magistrate of any area
<li><a href="#is_magistrate_anywhere">is_magistrate_anywhere</a>(string)<br/>
This method checks to see if the person is a magistrate anywhere.
<li><a href="#is_magistrate_of">is_magistrate_of</a>(string, string)<br/>
This method checks to see if the specified person is a magistrate or
not.
<li><a href="#normalize_area">normalize_area</a>(string)<br/>
This method normalizes an area name, turns it into the name to
use as an index.
<li><a href="#player_delete">player_delete</a>(string, int)<br/>
This is the function called by the refresh-handler when a player is deleted
<li><a href="#player_refresh">player_refresh</a>(object, int)<br/>
This is the function called by the refresh-handler when a player refreshes 
<li><a href="#query_citizen">query_citizen</a>(string)<br/>
This method checks to see if the specified person is a citizen and
where they are a citizen.
<li><a href="#query_citizenship_areas">query_citizenship_areas</a>()<br/>
This method returns all the areas for citizenship.
<li><a href="#query_citizenships">query_citizenships</a>(string)<br/>
This method checks to see where a person has citizenships.
<li><a href="#query_magistrates">query_magistrates</a>(string)<br/>
This method returns the current magistrates for the area.
<li><a href="#query_number_of_citizens">query_number_of_citizens</a>(string)<br/>
This method returns the number of citizens in the given area.
<li><a href="#query_number_of_magistrates">query_number_of_magistrates</a>(string)<br/>
This method returns the number of magistrates needed for the area.
<li><a href="#remove_citizen">remove_citizen</a>(string, string)<br/>
This method removes a citizen from the specified area.
<li><a href="#setup_magistrates">setup_magistrates</a>(string, string *)<br/>
This method sets up a new bunch of elected magistrates.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_citizen">
add_citizen</a><pre class="autodocfuncdef">
int add_citizen(string area,
                string citizen)
</pre><dd><br />
This method adds a citizen to the specified area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to add the citizen too<br />
citizen - the citizen to add to the area
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="add_magistrate">
add_magistrate</a><pre class="autodocfuncdef">
int add_magistrate(string area,
                   string magistrate)
</pre><dd><br />
This method adds a magistrate to the area.  If there are no more
magistrate slots then this fails.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to add the magistrate too<br />
magistrate - the magistrate to add
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="create_area">
create_area</a><pre class="autodocfuncdef">
int create_area(string area,
                int num_magistrates)
</pre><dd><br />
This method creates an area for citizens to womble in.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the name of the area to create<br />
num_magistrates - the number of magistrates<br />
<br />
<dd><b>Returns:</b>
<br />1 on succes, 0 on failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_citizen_of">
is_citizen_of</a><pre class="autodocfuncdef">
int is_citizen_of(string area,
                  string citizen)
</pre><dd><br />
This method checks to see if the specified person is a citizen or
not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check them in<br />
citizen - the person to check for citizenship<br />
<br />
<dd><b>Returns:</b>
<br />1 if they are a citizen, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_magistrate">
is_magistrate</a><pre class="autodocfuncdef">
int is_magistrate(string magistrate)
</pre><dd><br />
This method determines if someone is a magistrate of any area<br />
<br /><dl>
<dd><b>Parameters:</b><br />
magistrate - the person to check for magistrateship<br />
<br />
<dd><b>Returns:</b>
<br />1 if they are a magistrate, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_magistrate_anywhere">
is_magistrate_anywhere</a><pre class="autodocfuncdef">
int is_magistrate_anywhere(string person)
</pre><dd><br />
This method checks to see if the person is a magistrate anywhere.
It will return 1 if they are a magistrate, 0 if they are not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
person - the person to check<br />
<br />
<dd><b>Returns:</b>
<br />1 if they are, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_magistrate_of">
is_magistrate_of</a><pre class="autodocfuncdef">
int is_magistrate_of(string area,
                     string magistrate)
</pre><dd><br />
This method checks to see if the specified person is a magistrate or
not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check them in<br />
magistrate - the person to check for magistrateship<br />
<br />
<dd><b>Returns:</b>
<br />1 if they are a magistrate, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="normalize_area">
normalize_area</a><pre class="autodocfuncdef">
string normalize_area(string area)
</pre><dd><br />
This method normalizes an area name, turns it into the name to
use as an index.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area name to lookup
<br />
<br />
<dd><b>Returns:</b>
<br />the name to use as an index<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="player_delete">
player_delete</a><pre class="autodocfuncdef">
void player_delete(string name,
                   int type)
</pre><dd><br />
This is the function called by the refresh-handler when a player is deleted<br />
<br /><dl>
<dd><b>Parameters:</b><br />
name - The player's name<br />
type - The type of the event.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="player_refresh">
player_refresh</a><pre class="autodocfuncdef">
void player_refresh(object player,
                    int type)
</pre><dd><br />
This is the function called by the refresh-handler when a player refreshes <br />
<br /><dl>
<dd><b>Parameters:</b><br />
player - The player object<br />
type - The type of the event.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_citizen">
query_citizen</a><pre class="autodocfuncdef">
string query_citizen(string citizen)
</pre><dd><br />
This method checks to see if the specified person is a citizen and
where they are a citizen.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
citizen - the person to find where they are the citizen of<br />
<br />
<dd><b>Returns:</b>
<br />where they are a citizen, or 0 on failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_citizenship_areas">
query_citizenship_areas</a><pre class="autodocfuncdef">
string * query_citizenship_areas()
</pre><dd><br />
This method returns all the areas for citizenship.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the possible areas for citizenship
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_citizenships">
query_citizenships</a><pre class="autodocfuncdef">
string * query_citizenships(string citizen)
</pre><dd><br />
This method checks to see where a person has citizenships.  Do not use 
unless absolytely nessessary.  In most cases you should know which area 
you are querying for citizenship.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
citizen - the person to find where they are the citizen of<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_magistrates">
query_magistrates</a><pre class="autodocfuncdef">
string * query_magistrates(string area)
</pre><dd><br />
This method returns the current magistrates for the area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to get the magistrates for<br />
<br />
<dd><b>Returns:</b>
<br />the array of the current magistrates
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_number_of_citizens">
query_number_of_citizens</a><pre class="autodocfuncdef">
int query_number_of_citizens(string area)
</pre><dd><br />
This method returns the number of citizens in the given area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to lookup<br />
<br />
<dd><b>Returns:</b>
<br />the number of citizens
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_number_of_magistrates">
query_number_of_magistrates</a><pre class="autodocfuncdef">
int query_number_of_magistrates(string area)
</pre><dd><br />
This method returns the number of magistrates needed for the area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check the magistrates for<br />
<br />
<dd><b>Returns:</b>
<br />the number of allow\ed magistrates
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_citizen">
remove_citizen</a><pre class="autodocfuncdef">
int remove_citizen(string area,
                   string citizen)
</pre><dd><br />
This method removes a citizen from the specified area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to remove the citizen from<br />
citizen - the citizen to remove from the area
<br />
<br />
<br /></dl>

</dl>
<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<dl>
<dt class="autodocfuncname"><a name="setup_magistrates">
setup_magistrates</a><pre class="autodocfuncdef">
void setup_magistrates(string area,
                       string * magistrates)
</pre><dd><br />
This method sets up a new bunch of elected magistrates.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to setup them up in<br />
magistrates - the new bunch to setup
<br />
<br />
<br /></dl>

</dl>
[an error occurred while processing this directive]

