[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/inherit/club_family.c

This piece of the club handler deals with families and relationships.

Written by Pinkfish and Balev

Started Sun Sep 27 03:35:42 EDT 1998

Inherits

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

Includes

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

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_relationship
int add_relationship(string name,
                     string person,
                     string dest_name,
                     string dest,
                     string relationship)

This method adds a relationship between two members of a family.

Parameters:
name - the name of the family
person - the person the relationship is from
dest - the person the relationship is to
dest_name - the name of the family the other person is in
relationship - the relationship they have to you

Returns:
1 if succcessful, 0 if not


add_relationship_type
varargs void add_relationship_type(int flags,
                                   string relation1,
                                   string male1,
                                   string female1,
                                   string relation2,
                                   string male2,
                                   string female2)

Add a relationship to the relationship system. If only one relationship is passed, it is its own opposite. If there are two, they are opposites of each other.

Parameters:
flags - Relationship flags
relation1 - Primary relationship name (e.g. "parent")
male1 - The male adjective in the relationship (e.g. "father")
female1 - The female adjective in the relationship (e.g. "mother")
relation2 - Secondary relationship name (e.g. "child")
male2 - The male adjective in the relationship (e.g. "son")
female2 - The female adjective in the relationship (e.g. "daughter")


add_valid_relationship
void add_valid_relationship(string relation1,
                            string relation2,
                            int flags)

This method adds a valid relationship to the current list.

Parameters:
relation1 - the first relationship
relation2 - the second relationship
flags - Control flags for this relationship

See also:
query_opposite_relationship(), is_valid_interfamily_relationship(), is_valid_join_family_relationship() and is_valid_relationship()


is_blood_bound_family_relationship
int is_blood_bound_family_relationship(string str)

Check to see if a relationship is bound in blood. A blood-bound relationship cannot be dissolved on a whim.

Parameters:
str - Name of the relationship (e.g. sibling) to test

Returns:
1 if the relationship is valid and bound by blood, 0 otherwise

See also:
is_valid_relationship(), is_valid_interfamily_relationship(), add_valid_relationship(), query_opposite_relationship() and query_ungendered_relationship()


is_broken_relationship
int is_broken_relationship(string name,
                           string person,
                           string dest_name,
                           string dest,
                           string relationship)
is_relationship
int is_relationship(string name,
                    string person,
                    string related,
                    string relationship)

This method checks to see if the specified relationship exists.

Parameters:
name - the family the relationship is in
person - the person the relationship is from
related - to person they are related to
relationship - the type of relationship they have

Returns:
1 if the relationship exists, 0 if not


is_valid_interfamily_relationship
int is_valid_interfamily_relationship(string str)

This method checks to see if the relation is a valid interfamily one.

Parameters:
str - the ungendered relationship to check

Returns:
1 if the relation is a valid interfamily one

See also:
is_valid_relationship() and is_valid_join_family_relationship()


is_valid_join_family_relationship
int is_valid_join_family_relationship(string str)

This method checks to see if the relation is a valid join family one.

Parameters:
str - the ungendered relationship to check

Returns:
1 if the relation is a valid join family one

See also:
is_valid_relationship(), is_valid_interfamily_relationship(), add_valid_relationship(), query_opposite_relationship() and query_ungendered_relationship()


is_valid_relationship
int is_valid_relationship(string str)

This method checks to make sure the specified relationship is valid.

Parameters:
relation - the relationship to check for validity

Returns:
1 if the relationship is valid

See also:
query_opposite_relationship(), is_valid_interfamily_relationship(), is_valid_join_family_relationship() and add_valid_relationship()


move_family_member
int move_family_member(string curr_family,
                       string person,
                       string dest_family)

This method moves a person from one family to another family.

Parameters:
curr_family - the current family
person - the persons name
dest_family - the destination family

Returns:
1 if successful moved

See also:
add_member()


query_all_relationships
string * query_all_relationships()

This method returns all the possible relationships, including the gendered ones.

Returns:
the array of possible relationships

See also:
query_ungendered_relationship() and add_gender_relationship()


query_all_valid_relationships
string * query_all_valid_relationships()

This method returns all the valid relationships.

Returns:
all the current valid relationship types

See also:
add_valid_relationship(), is_valid_interfamily_relationship(), is_valid_join_family_relationship(), is_valid_relationship() and query_opposite_relationship()


query_blood_relationships
string * query_blood_relationships()

This method returns all of the blood relationships.

Returns:
all the current blood-type relationships

See also:
query_non_blood_relationships() and query_all_valid_relationships()


query_club_cost_per_period
int query_club_cost_per_period(string club_name)

This method determines how much the club will cost to run each pay period.

Parameters:
club_name - the name of the club to get the fees for

Returns:
the amount the club will cost in the next pay period

See also:
query_time_fees_due()


query_non_blood_relationships
string * query_non_blood_relationships()

This method returns all of the non blood relationships.

Returns:
all the current non-blood-type relationships

See also:
query_blood_relationships() and query_all_valid_relationships()


query_opposite_relationship
string query_opposite_relationship(string relation)

This method returns the opposite relationship to the specified one.

Parameters:
ungendered - relation the relation to return the opposite of

Returns:
the opposite of the relationship

See also:
add_valid_relationship(), is_valid_interfamily_relationship(), is_valid_join_family_relationship(), is_valid_relationship() and query_ungendered_relationship()


query_relationship_gender
string query_relationship_gender(string relationship,
                                 int female)

This method returns the genderised version of the relationship.

Parameters:
name - relationship the relation to get the gender of
female - 0 for male, 1 for female

See also:
query_all_relationships(), query_ungendered_relationship(), add_gender_relationships() and query_all_relationships()


query_relationships
class relationship_data * query_relationships(string name,
                                              string person)

This method returns the relationships the selected person has to the other people in the family.

Parameters:
name - the name of the family
person - the person who to query the relationships for

Returns:
the list of all the relationships the person has


query_relationships_to
string * query_relationships_to(string name,
                                string person,
                                string related)

This method returns how the first player is related to the second player.

Parameters:
name - the family the relationship is in
person - the person the relationship is from
related - to person they are related to

Returns:
the array of relationships they have


query_ungendered_relationship
string query_ungendered_relationship(string relationship)

This returns the real relationship type based on the possible genderised relationship.

Parameters:
relationship - the relationship to get the real relationship for

Returns:
the ungendered relationship name

See also:
add_gender_relationship() and query_all_relationship_types()


remove_relationship
int remove_relationship(string name,
                        string person,
                        string dest_name,
                        string dest,
                        string relationship)

This method removes a relationship from the club.

Parameters:
name - the name of the family
person - the person the relationship is from
dest_name - the family name of dest
dest - the person the relationship is to
relationship - the relationship they have to you

Returns:
1 if succcessful, 0 if not


Protected Functions

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

check_family_information
void check_family_information(string name,
                              string member,
                              int startup)

This method checks the extra information for the club. Please note this does *not* save the information. You need to do this yourself.

Parameters:
name - the name of the club to check

See also:
check_clubs() and remove_member()


create_extra_data
void create_extra_data(string name)

Classes

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