[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/inherit/club_discuss.c

This is the handler for all things clubby, a club being a group of players. Each club must have a unique name. It also handles elections for various club positions.

Written by Pinkfish

Started Sun Sep 27 03:35:42 EDT 1998

Inherits

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

Includes

This class includes the following files /include/clubs.h, /include/player_handler.h, /include/mail.h, /include/broadcaster.h and /include/am_time.h

Method index

Public Functions

These are functions that everyone can access.

add_discussion_item
int add_discussion_item(string club,
                        int type,
                        string added_by,
                        string name,
                        string info,
                        string * choices,
                        int time_to_finish,
                        mixed extra_data)

This method will add a discussion item to the table to be voted on.

Parameters:
club - the club the item is being added to
type - the type of the discussion item to be added
added_by - who added the discussion item
name - the name of the discussion item
choices - the choices for the discussion item
time_to_finish - the amount of time the election has to run
extra_data - any optional data associated with the discussion idea

Returns:
1 if successfully added, 0 if not


can_reference_discussion_item
int can_reference_discussion_item(string club_name,
                                  int id,
                                  string person)

This method checks to see if the specified person can see the discussion idea.

Parameters:
club_name - the name of the club
id - the id of the discussion idea
person - the name of the person

See also:
vote_for_discussion_item()


complete_discussion_item
int complete_discussion_item(string club_name,
                             int id)

This method completes the discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
1 if successful, 0 if not

See also:
add_discussion_item()


has_voted_for_discussion_item
int has_voted_for_discussion_item(string club_name,
                                  int id,
                                  string person)

This method checks to see if the specified person has already voted for this discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item
person - the name of the person to check


is_committee_discussion_item
int is_committee_discussion_item(string club_name,
                                 int id)

This method checks to see if the discussion item is a committee only item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
1 if it is a committee only item, 0 if it is open


is_discuss_nominateable
int is_discuss_nominateable(string club_name,
                            int id)

This method checks to see if the discussion item is a votable item or not.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
1 if it is votable, 0 if not


is_discuss_person_nominated
int is_discuss_person_nominated(string club_name,
                                int id,
                                string nominator,
                                string nominated)

This method checks to see if the given nomination has already been done.

Parameters:
club_name - the name of the club
id - the id of the discussion ite,
nominator - the person doing the nomination
nominated - the person being nominated

Returns:
1 if they are already nominated, 0 if not


is_discuss_votable
int is_discuss_votable(string club_name,
                       int id)

This method checks to see if the discussion item is a votable item or not.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
1 if it is votable, 0 if not


is_discussion_item_finished
int is_discussion_item_finished(string club_name,
                                int id)

This method checks to see if the discussion item is completed yet.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
1 if the discussion item is finished

See also:
vote_for_discussion_item()


is_discussion_item_quorum
int is_discussion_item_quorum(string club_name,
                              int id)

This method checks to see if quorum has been reached or not for the club.

Parameters:
club_name - the name of the club to check for quorum
id - the discussion item id

Returns:
1 if quorum is reached, 0 if not


is_discussion_position_valid
int is_discussion_position_valid(string club_name,
                                 string position)

This is a special function to be used with the discuss items to make sure that there is not another discussion item checking the same name.

Parameters:
club_name - the name of the club to check
position - the position to check for

Returns:
1 if the position is being discussed as an item


is_no_quorum_discussion_item
int is_no_quorum_discussion_item(string club_name,
                                 int id)

This method checks to see if the discussion item has no quorum associated with it.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
1 if it has no quorum, 0 if it is does


is_valid_discussion_choice
int is_valid_discussion_choice(string club_name,
                               int id,
                               string choice)

This checks to see if the specified choice is a real discussion item choice.

Parameters:
club_name - the name of the club
id - the id of the discussion item
choice - the choice to check


is_valid_discussion_item_type
int is_valid_discussion_item_type(int type)

This method checks to make sure the type of the discussion item is valid.

Parameters:
type - the type of the discussion item

Returns:
1 if it is valid, 0 if not


nominate_discussion_item
int nominate_discussion_item(string club_name,
                             int id,
                             string nominator,
                             string nominated)

This message does the nomination thing for those discussion items which accept nominations.

Parameters:
club_name - the name of the club
id - the id of the discussion item
nominator - the person doing the nomination
nominated - the person nominated


query_all_discussion_items
class discussion_idea * query_all_discussion_items(string club_name)

This method returns all the current discussion items for this club.

Parameters:
club_name - the name of the club to query the discussion items for

Returns:
the list of current discussion items


query_discussion_added_by
string query_discussion_added_by(string club_name,
                                 int id)

This method returns the person who added the discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
the name of the person who added the discussion item


query_discussion_choices
string * query_discussion_choices(string club_name,
                                  int id)

This method returns all the choices for this discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
an array of the valid set of choices, empty array on failure


query_discussion_item
class discussion_idea query_discussion_item(string club_name,
                                            int id)

This method figures out the discussion item for the club with the given id.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
the found discussion item

See also:
add_discussion_item()


query_discussion_item_by_type
class discussion_idea query_discussion_item_by_type(string club_name,
                                                    int type,
                                                    class discussion_idea idea)

This method figures out the discussion item for the club with the given type. It will also continue on a search from a last found item.

Parameters:
club_name - the name of the club
type - the type of the discussion item to find

Returns:
the found discussion item

See also:
add_discussion_item()


query_discussion_item_long_description
string query_discussion_item_long_description(string club_name,
                                              int id)

This method returns a nice little description of the discussion item. This is a longer description, useful in more places.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
a long description of the item


query_discussion_item_number_voted
int query_discussion_item_number_voted(string club_name,
                                       int id)

This method returns the number of people who have voted for the discussion item.

Parameters:
club_name - the name of the club to check for quorum
id - the discussion item id

Returns:
the number of people who have voted


query_discussion_item_quorum_number
int query_discussion_item_quorum_number(string club_name,
                                        int id)

This method returns the number of people needed for quorum in this discussion item.

Parameters:
club_name - the name of the club to check for quorum
id - the discussion item id

Returns:
the number of people needed for quorum


query_discussion_item_short_description
string query_discussion_item_short_description(string club_name,
                                               int id)

This method returns a nice little description of the discussion item. This is a very short description usable in lists and stuff.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
a short description of the item


query_discussion_nomination
mapping query_discussion_nomination(string club_name,
                                    int id)

This method returns the nomination mapping for the discussion item if it exists. The nomination mapping is of the format:
([
   name : ({ nomated_by, nominated_by, ... })
   ..
 ])


Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
the mapping as described above


query_discussion_optional_data
mixed query_discussion_optional_data(string club_name,
                                     int id)

This method returns the optional data of the discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
the optional data in the club


query_discussion_time_added
int query_discussion_time_added(string club_name,
                                int id)

This method returns the timeout time of the current discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
the time at which the dicussion item will finish


query_discussion_time_finish
int query_discussion_time_finish(string club_name,
                                 int id)

This method returns the timeout time of the current discussion item.

Parameters:
club_name - the name of the club
id - the id of the discussion item

Returns:
the time at which the dicussion item will finish


setup_by_election
int setup_by_election(string club,
                      string position,
                      string info)

This method setups up a by-election for the specified position in the club.

Parameters:
club - the club to make a byelection in
position - the position the byelection is for
info - the information about the vote

Returns:
1 on success, 0 on failure


vote_for_discussion_item
int vote_for_discussion_item(string club_name,
                             int id,
                             string person,
                             string choice)

This method sets up the discussion item as being voted by the person specified.

Parameters:
club_name - the name of the club
id - the id of the discussion item
person - the person doing the voting
choice - the choices there are to vote on

See also:
add_discussion_item()


withdraw_discussion_item
int withdraw_discussion_item(string club_name,
                             int id,
                             string withdraw)

This message does the withdraw thing for those discussion items which accept nominations.

Parameters:
club_name - the name of the club
id - the id of the discussion item
withdraw - the person being withdrawn


Protected Functions

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

archive_discussion_item
int archive_discussion_item(string club_name,
                            string subject,
                            string item)

This method is called when a discussion item is finished. It then archives it or whatever else it wishes to do with the item

Parameters:
club_name - the name of the club
item - the text string of the finished item


broadcast_discuss_message
void broadcast_discuss_message(string club_name,
                               int message,
                               string arg1,
                               string arg2)

This method sends a message to all the discussion items in the club and then marks the club as changed if any of them return a non-zero value. This is used for events like a member being removed of a position being changed in name.

Parameters:
club_name - the name of the club
message - the message number
arg1 - the first arguement
arg2 - the second arguement


remove_discussion_item
int remove_discussion_item(string club_name,
                           class discussion_idea item)

This method removes a discussion item from the club.

Parameters:
club_name - the name of the club to remove the discussion item
item - the discusion item to remove

Returns:
1 on success, 0 on failure


send_discuss_message
mixed send_discuss_message(string club_name,
                           int message,
                           class discussion_idea item,
                           string arg1,
                           string arg2)

This method sends a message to all the discussion items in the club and then marks the club as changed if any of them return a non-zero value. This is used for events like a member being removed of a position being changed in name.

Parameters:
club_name - the name of the club
message - the message number
arg1 - the first arguement
arg2 - the second arguement