[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/inherit/citizen_elections.c

This is the file used to do elections for magistrate positions.

Written by Pinkfish

Started Mon Oct 23 22:30:19 PDT 2000

Inherits

This class inherits the following classes /obj/handlers/inherit/citizens.c

Includes

This class includes the following files /include/player_handler.h, /include/playtesters.h, /include/player.h, /include/nomic_system.h and /include/board.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

disable_citizen_election
int disable_citizen_election(string area)

This method sets the specifed election to "disabled", meaning it will sit indefinitely with no election.
has_voted
int has_voted(string area,
              string person)

This method checks to see if the specified person has voted.

Parameters:
area - the area to check in
person - the person the check

Returns:
1 if they have voted, 0 if not


is_election_phase
int is_election_phase(string area)

This method checks to see if we are in the election phase.

Parameters:
area - the area to check

Returns:
1 if we are, 0 if not


is_eligible_to_vote_for
int is_eligible_to_vote_for(string area,
                            string person)

This method checks to see if the specified person is an eligible person to vote for.

Parameters:
area - the area to checlk
person - the person to check

Returns:
1 if they are, 0 if not


is_grace_phase
int is_grace_phase(string area)

This method checks to see if we are in the grace phase.

Parameters:
area - the area to check

Returns:
1 if we are, 0 if not


is_nomination_accepted
int is_nomination_accepted(string area,
                           string person)

This method checks to see if the specifiedf person has accepted their nomination or not.

Parameters:
area - the area to check in
person - the person to check to see if they have accepted

Returns:
1 if they are accepted, 0 if not


is_nomination_phase
int is_nomination_phase(string area)

This method checks to see if we are in the nomination phase.

Parameters:
area - the area to check

Returns:
1 if we are, 0 if not


nominate_magistrate
int nominate_magistrate(string area,
                        string person,
                        string nominator)

This method nominates a person for a position.

Parameters:
area - the area to nominate in
person - the being nominated
nominator - the person doing the nomination

Returns:
1 on success, 0 on failure


post_citizen_message
int post_citizen_message(string area,
                         string subject,
                         string message)

This method will post a message to the citizen board from the administration.

Parameters:
area - the area to post the message to
subject - the subject it has
message - the message to post


post_magistrate_message
int post_magistrate_message(string area,
                            string subject,
                            string message)

This method will post a message to the magistrate board from the administration.

Parameters:
area - the area to post the message to
subject - the subject it has
message - the message to post


query_can_vote_for
string * query_can_vote_for(string area)

This method retuns the list of people that can be voted for.

Parameters:
area - the area to check in

Returns:
the array of people that can be voted for


query_citizen_board
string query_citizen_board(string area)

This method returns the board for the specified area.

Parameters:
area - the area to look for the board on

Returns:
the board name for the area, 0 for none


query_end_of_phase_time
int query_end_of_phase_time(string area)

This method returns the end of the phase time.

Returns:
the end of the phase time, 0 on failure


query_magistrate_board
string query_magistrate_board(string area)

This method returns the board for the specified area.

Parameters:
area - the area to look for the board on

Returns:
the board name for the area, 0 for none


query_next_election_time
int query_next_election_time(string area)

This method returns the time of the next election.

Returns:
the time of the next election, 0 if on is in progress


query_nominated_by
string * query_nominated_by(string area,
                            string person)

This method checks to see who has nominated a specified person.

Parameters:
area - the area to check
person - the person to check

Returns:
the array of people who have nominated the person


query_people_nominated
string * query_people_nominated(string area)

This method returns the list of people who have been nominated.

Parameters:
area - the area to get the list of people who are nominated

Returns:
the list of people who have been nominated


set_citizen_board
void set_citizen_board(string area,
                       string name)

This method sets the board for the specified area.

Parameters:
area - the area to set the board for
name - the name of the board


set_magistrate_board
void set_magistrate_board(string area,
                          string name)

This method sets the board for the specified area.

Parameters:
area - the area to set the board for
name - the name of the board


vote_for_people
int vote_for_people(string area,
                    string * people,
                    string voter)

This method votes for a specified person in the area.

Parameters:
area - the area to vote for someone in
person - the person to vote for
voter - the person voting

Returns:
1 on success, 0 on failure


Protected Functions

These are functions that only objects inheriting the class can access.

finish_election_phase
void finish_election_phase(string area)

This method finishes the election phase.

Parameters:
area - the area to finish the phase for


finish_nomination_phase
void finish_nomination_phase(string area)

This method finishes the nomination phase.

Parameters:
area - the area to finish the phase for


query_election_phase
int query_election_phase(string area)

This method returns the phase of the election.

Parameters:
area - the area to check

Returns:
the election phase


start_election
void start_election(string area)

This method starts the election.

Parameters:
area - the area to do the election for


Classes

These are nice data types for dealing with... Data!