[Package Index | Mudlib Index | Effect Index]
The room does not inherantly support player initiated votes, however it is a fairly simple matter to add this to your own room and have your room add votes when players initiate them.
Written by Ceres
.
void add_vote(string type, string description, string * choices, int ending)This function is called to add a vote to the system.
int cast_vote(string which_str, int vote_id)This function is called when a player votes. The syntax is "vote
int delete_election(string election)This is an administrative function to allow the removal/cancellation of an election.
int delete_vote(int vote_id)This is an administrative function to allow the removal/cancellation of a vote.
int do_create_vote(string choices)This is an option function which can be defined in upper level inherits. It allows the players to create their own votes with their own choices.
void end_vote(int which)This function is called to terminate a vote. It calls your completion action.
void init_add_vote()This is the init() which should be called as well as the default init() if you wish to have player added votes.
void initiate_election(string position)This function is used to initiate an election. It sets up the election class and adds it to the mapping.
int list_elections()This function is called when a player types 'elections'. It lists the elections currently accepting candidates.
int list_votes()This function is called when a player types 'list'. It lists the currently open votes.
void make_announcement(string board, string name, string subject, string message)This function is provided for convenience to make it easy for your vote end function to post to a board.
int query_election_in_progress(string position)This method determines if there is already an election of the specified type in progress.
int query_open_voting(int open)This function queries if the votes should be open or not. If a vote is open then you know who voted for each thing.
string query_save_file()This method returns the save file currently used for the room.
int query_vote_duration()This function is used to returns the normal vote and election duration. If it is not set and no duration is given in add_vote then the default value of DEFAULT_VOTE_DURATION is used.
int second_candidate(string who, string position)This function is used by players to second candidates for election. If a candidates isn't seconded he/she won't be in the election. The syntax is: "second
void set_completion_action(mixed cond)This function defines a function to be called when the vote is complete. Typically your function will post the vote results somewhere or somesuch. The parameters passedinto the function are:
void set_election_announcement(string board, string person, string subject, string prefix, string suffix)This function defines the board, person and subject for announcements of elections.
void set_no_elections(int no_elections)This method sets the room to not allow elections and disable all the election commands.
void set_open_voting(int open)This function setups if the votes should be open or not. If a vote is open then you know who voted for each thing.
void set_proxy(string proxy)This method sets up a proxy for the room. A proxy is somewhere else to get all the voting information from.
void set_save_file(string file)This method is called by the inheriting object to determine which save file to use for votes.
void set_second_conditions(mixed cond)This function defines a function to be called to determine if a player is eligible to second a canditate for election.
void set_stand_conditions(mixed cond)This function defines a function to be called to determine if a player is eligible to stand for election to a position.
void set_vote_conditions(mixed cond)This function defines a function to be called to determine if a player is eligible to vote.
void set_vote_duration(int duration)This function is used to set the normal vote and election duration. It can be overridden when calling add_vote. If it is not set and no duration is given in add_vote then the default value of DEFAULT_VOTE_DURATION is used.
void setup_after_load()This setups all the stuff that needs to be setup after the room has been loaded. Makes all the callouts for the right amount of time and so on.
int stand_for_election(string position)This function is used by players to stand for election. The syntax is: "stand for
void start_election_vote(string post)Once the candidacy phase is over this function starts the election vote itself by taking all eligible candidates, setting them as choices in the election and then posting an announcemment.
void add_our_election(string name, class election data)This method adds in a election.
void add_our_vote(int id, class vote data)This method adds in a vote.
mapping query_our_elections()This method is used to return the current elections. This can be overridden in hgiher inherits to control things better.
mapping query_our_votes()This method is used to return the current votes. This can be overridden in higher functions to get the votes from somewhere else if nessessary.
void save_room()Private function to save the rooms data file.
class election { mixed * candidates; int closes; }
class vote { string type; string desc; string * choices; mixed * votes; int ending; string * voted; }