[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/inherit/nomic_rules.c

This handler deals with all the nomic rules for councils.

Written by Pinkfish

Started Fri Jun 23 19:51:04 PDT 2000

Includes

This class includes the following files /include/nomic_system.h

Method index

Public Functions

These are functions that everyone can access.

add_nomic_rule
int add_nomic_rule(string area,
                   int type,
                   string creator,
                   string text)

This method adds a nomic rule into the system.

Parameters:
area - the area the rule is added in
type - the type of rule to add
creator - the person that created the rule
text - the text associated with the rule

Returns:
the new number of the rule, NOMIC_ERROR on fai;l


change_nomic_rule
int change_nomic_rule(string area,
                      class nomic_rule rule)

This method moves a rule from one type to another.

Parameters:
area - the area the rule is added in
rule - the rule to move
type - the new type of the rule

Returns:
the new number of the rule, NOMIC_ERROR on fai;l


create_area
int create_area(string area)

This method creates an new nomic area.

Parameters:
area - the new nomic area name

Returns:
1 on success, 0 on failure


find_nomic_rule
class nomic_rule find_nomic_rule(string area,
                                 string creator,
                                 string text)

This method searches through for the specified rule. This stops the same rule being added more than once by some error in the code.

Parameters:
area - the area the rule is in
creator - the creator of the rule
text - the text of the rule

Returns:
the rule if it is found, 0 if not


int_remove_nomic_rule
int int_remove_nomic_rule(string area,
                          int id)

This method by passes the standard nomic rules check, it can be used to remove an immutable rule.
query_all_nomic_rules
class nomic_rule * query_all_nomic_rules(string area)

This method returns all the nomic rules for the area.

Parameters:
area - the area to get the rule sin

Returns:
all the rules


query_can_change_rule
int query_can_change_rule(string area,
                          class nomic_rule rule)

This method checks to see if the specified rule can be changed.

Parameters:
area - the area in which the rule will be changed in
rule - the rule to check

Returns:
1 if it can be changed, 0 if not


query_nomic_rule
class nomic_rule query_nomic_rule(string area,
                                  int id)

This method returns a nomic rule for the specified area.

Parameters:
area - the area to get the rule in
id - the id of the rule to match

Returns:
0 if failed, the class if succeeded


query_type_name
string query_type_name(int type_no)

This method returns the name of the corresponding type name.

Parameters:
type_no - the type number

Returns:
the type name string


query_type_number
int query_type_number(string name)

This method returns the number for the corresponding type name.

Parameters:
name - the name of the area to get the number of

Returns:
the type number


remove_nomic_rule
int remove_nomic_rule(string area,
                      int id)

This method removes a nomic rule from the system.

Parameters:
area - the area the rule is removed in
id - the id of the rule to remove

Returns:
the status of the removal, NOMIC_ERROR on fai;l


rule_as_string
string rule_as_string(int indent,
                      class nomic_rule rule)

This method returns the rule as a string.

Parameters:
rule - the rule to make a string

Returns:
the string version of us


Protected Functions

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

add_nomic_rule_class
int add_nomic_rule_class(string area,
                         class nomic_rule new_rule,
                         int type)

This method adds a nomic rule into the system.

Parameters:
area - the area the rule is added in
new_rule - the rule that is being added
type - the type of the rule

Returns:
the new number of the rule, NOMIC_ERROR on fai;l


move_nomic_rule
int move_nomic_rule(string area,
                    class nomic_rule rule,
                    int type)

This method moves a rule from one type to another.

Parameters:
area - the area the rule is added in
rule - the rule to move
type - the new type of the rule

Returns:
the new number of the rule, NOMIC_ERROR on fai;l