[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/citizen_elections.c</h2>
This is the file used to do elections for magistrate positions.<p>Written by Pinkfish<p>Started Mon Oct 23 22:30:19 PDT 2000
<h2>Inherits</h2>
This class inherits the following classes <a href="obj.handlers.inherit.citizens.c.shtml">/obj/handlers/inherit/citizens.c</a><h2>Includes</h2>
This class includes the following files /include/player_handler.h, /include/playtesters.h, /include/player.h, /include/nomic_system.h and /include/board.h<h2>Class Index</h2>
<ul><li><a href="#class_election_data">election_data</a>
</ul><h2>Method index</h2>
<ul>
<li><a href="#disable_citizen_election">disable_citizen_election</a>(string)<br/>
This method sets the specifed election to "disabled", meaning it will
sit indefinitely with no election.
<li><a href="#finish_election_phase">finish_election_phase</a>(string)<br/>
This method finishes the election phase.
<li><a href="#finish_nomination_phase">finish_nomination_phase</a>(string)<br/>
This method finishes the nomination phase.
<li><a href="#has_voted">has_voted</a>(string, string)<br/>
This method checks to see if the specified person has voted.
<li><a href="#is_election_phase">is_election_phase</a>(string)<br/>
This method checks to see if we are in the election phase.
<li><a href="#is_eligible_to_vote_for">is_eligible_to_vote_for</a>(string, string)<br/>
This method checks to see if the specified person is an eligible
person to vote for.
<li><a href="#is_grace_phase">is_grace_phase</a>(string)<br/>
This method checks to see if we are in the grace phase.
<li><a href="#is_nomination_accepted">is_nomination_accepted</a>(string, string)<br/>
This method checks to see if the specifiedf person has accepted their
nomination or not.
<li><a href="#is_nomination_phase">is_nomination_phase</a>(string)<br/>
This method checks to see if we are in the nomination phase.
<li><a href="#nominate_magistrate">nominate_magistrate</a>(string, string, string)<br/>
This method nominates a person for a position.
<li><a href="#post_citizen_message">post_citizen_message</a>(string, string, string)<br/>
This method will post a message to the citizen board from the
administration.
<li><a href="#post_magistrate_message">post_magistrate_message</a>(string, string, string)<br/>
This method will post a message to the magistrate board from the
administration.
<li><a href="#query_can_vote_for">query_can_vote_for</a>(string)<br/>
This method retuns the list of people that can be voted for.
<li><a href="#query_citizen_board">query_citizen_board</a>(string)<br/>
This method returns the board for the specified area.
<li><a href="#query_election_phase">query_election_phase</a>(string)<br/>
This method returns the phase of the election.
<li><a href="#query_end_of_phase_time">query_end_of_phase_time</a>(string)<br/>
This method returns the end of the phase time.
<li><a href="#query_magistrate_board">query_magistrate_board</a>(string)<br/>
This method returns the board for the specified area.
<li><a href="#query_next_election_time">query_next_election_time</a>(string)<br/>
This method returns the time of the next election.
<li><a href="#query_nominated_by">query_nominated_by</a>(string, string)<br/>
This method checks to see who has nominated a specified person.
<li><a href="#query_people_nominated">query_people_nominated</a>(string)<br/>
This method returns the list of people who have been nominated.
<li><a href="#set_citizen_board">set_citizen_board</a>(string, string)<br/>
This method sets the board for the specified area.
<li><a href="#set_magistrate_board">set_magistrate_board</a>(string, string)<br/>
This method sets the board for the specified area.
<li><a href="#start_election">start_election</a>(string)<br/>
This method starts the election.
<li><a href="#vote_for_people">vote_for_people</a>(string, string *, string)<br/>
This method votes for a specified person in the area.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="disable_citizen_election">
disable_citizen_election</a><pre class="autodocfuncdef">
int disable_citizen_election(string area)
</pre><dd><br />
This method sets the specifed election to "disabled", meaning it will
sit indefinitely with no election.
<br />

<dt class="autodocfuncname"><a name="has_voted">
has_voted</a><pre class="autodocfuncdef">
int has_voted(string area,
              string person)
</pre><dd><br />
This method checks to see if the specified person has voted.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check in<br />
person - the person the check<br />
<br />
<dd><b>Returns:</b>
<br />1 if they have voted, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_election_phase">
is_election_phase</a><pre class="autodocfuncdef">
int is_election_phase(string area)
</pre><dd><br />
This method checks to see if we are in the election phase.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check<br />
<br />
<dd><b>Returns:</b>
<br />1 if we are, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_eligible_to_vote_for">
is_eligible_to_vote_for</a><pre class="autodocfuncdef">
int is_eligible_to_vote_for(string area,
                            string person)
</pre><dd><br />
This method checks to see if the specified person is an eligible
person to vote for.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to checlk<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_grace_phase">
is_grace_phase</a><pre class="autodocfuncdef">
int is_grace_phase(string area)
</pre><dd><br />
This method checks to see if we are in the grace phase.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check<br />
<br />
<dd><b>Returns:</b>
<br />1 if we are, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_nomination_accepted">
is_nomination_accepted</a><pre class="autodocfuncdef">
int is_nomination_accepted(string area,
                           string person)
</pre><dd><br />
This method checks to see if the specifiedf person has accepted their
nomination or not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check in<br />
person - the person to check to see if they have accepted<br />
<br />
<dd><b>Returns:</b>
<br />1 if they are accepted, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_nomination_phase">
is_nomination_phase</a><pre class="autodocfuncdef">
int is_nomination_phase(string area)
</pre><dd><br />
This method checks to see if we are in the nomination phase.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check<br />
<br />
<dd><b>Returns:</b>
<br />1 if we are, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="nominate_magistrate">
nominate_magistrate</a><pre class="autodocfuncdef">
int nominate_magistrate(string area,
                        string person,
                        string nominator)
</pre><dd><br />
This method nominates a person for a position.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to nominate in<br />
person - the being nominated<br />
nominator - the person doing the nomination<br />
<br />
<dd><b>Returns:</b>
<br />1 on success, 0 on failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="post_citizen_message">
post_citizen_message</a><pre class="autodocfuncdef">
int post_citizen_message(string area,
                         string subject,
                         string message)
</pre><dd><br />
This method will post a message to the citizen board from the
administration.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to post the message to <br />
subject - the subject it has<br />
message - the message to post
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="post_magistrate_message">
post_magistrate_message</a><pre class="autodocfuncdef">
int post_magistrate_message(string area,
                            string subject,
                            string message)
</pre><dd><br />
This method will post a message to the magistrate board from the
administration.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to post the message to <br />
subject - the subject it has<br />
message - the message to post
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_can_vote_for">
query_can_vote_for</a><pre class="autodocfuncdef">
string * query_can_vote_for(string area)
</pre><dd><br />
This method retuns the list of people that can be voted for.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check in<br />
<br />
<dd><b>Returns:</b>
<br />the array of people that can be voted for
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_citizen_board">
query_citizen_board</a><pre class="autodocfuncdef">
string query_citizen_board(string area)
</pre><dd><br />
This method returns the board for the specified area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to look for the board on<br />
<br />
<dd><b>Returns:</b>
<br />the board name for the area, 0 for none
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_end_of_phase_time">
query_end_of_phase_time</a><pre class="autodocfuncdef">
int query_end_of_phase_time(string area)
</pre><dd><br />
This method returns the end of the phase time.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the end of the phase time, 0 on failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_magistrate_board">
query_magistrate_board</a><pre class="autodocfuncdef">
string query_magistrate_board(string area)
</pre><dd><br />
This method returns the board for the specified area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to look for the board on<br />
<br />
<dd><b>Returns:</b>
<br />the board name for the area, 0 for none
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_next_election_time">
query_next_election_time</a><pre class="autodocfuncdef">
int query_next_election_time(string area)
</pre><dd><br />
This method returns the time of the next election.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the time of the next election, 0 if on is in progress
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_nominated_by">
query_nominated_by</a><pre class="autodocfuncdef">
string * query_nominated_by(string area,
                            string person)
</pre><dd><br />
This method checks to see who has nominated a specified person.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check<br />
person - the person to check<br />
<br />
<dd><b>Returns:</b>
<br />the array of people who have nominated the person
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_people_nominated">
query_people_nominated</a><pre class="autodocfuncdef">
string * query_people_nominated(string area)
</pre><dd><br />
This method returns the list of people who have been nominated.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to get the list of people who are nominated<br />
<br />
<dd><b>Returns:</b>
<br />the list of people who have been nominated
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_citizen_board">
set_citizen_board</a><pre class="autodocfuncdef">
void set_citizen_board(string area,
                       string name)
</pre><dd><br />
This method sets the board for the specified area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to set the board for<br />
name - the name of the board
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_magistrate_board">
set_magistrate_board</a><pre class="autodocfuncdef">
void set_magistrate_board(string area,
                          string name)
</pre><dd><br />
This method sets the board for the specified area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to set the board for<br />
name - the name of the board
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="vote_for_people">
vote_for_people</a><pre class="autodocfuncdef">
int vote_for_people(string area,
                    string * people,
                    string voter)
</pre><dd><br />
This method votes for a specified person in the area.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to vote for someone in<br />
person - the person to vote for<br />
voter - the person voting<br />
<br />
<dd><b>Returns:</b>
<br />1 on success, 0 on failure
<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="finish_election_phase">
finish_election_phase</a><pre class="autodocfuncdef">
void finish_election_phase(string area)
</pre><dd><br />
This method finishes the election phase.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to finish the phase for
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="finish_nomination_phase">
finish_nomination_phase</a><pre class="autodocfuncdef">
void finish_nomination_phase(string area)
</pre><dd><br />
This method finishes the nomination phase.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to finish the phase for
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_election_phase">
query_election_phase</a><pre class="autodocfuncdef">
int query_election_phase(string area)
</pre><dd><br />
This method returns the phase of the election.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to check<br />
<br />
<dd><b>Returns:</b>
<br />the election phase
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="start_election">
start_election</a><pre class="autodocfuncdef">
void start_election(string area)
</pre><dd><br />
This method starts the election.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
area - the area to do the election for
<br />
<br />
<br /></dl>

</dl>
<h2>Classes</h2>
These are nice data types for dealing with...  Data!<p>
<ul>
<li><a name="class_election_data">
election_data</a><pre>
class election_data {
                      int last_election;
                      int phase;
                      int phase_start;
                      mapping nominations;
                      mapping votes;
                      string * voted;
}

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

