[Package Index | Mudlib Index | Effect Index]

File /std/basic/id.c

This class keeps track of all the aliases, names and adjectives which are used to match the object.

See also:
/global/player->add_command() and /std/basic/desc.c

Inherits

This class inherits the following classes /std/basic/id_match.c

Includes

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

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_adjective
void add_adjective(mixed str)

This method adds an adjective to the object. The adjectives are used for the object matching routines. For example, if you have a "green bath tun" then "green" and "bath" are adjectives.

See also:
add_alias(), remove_adjective(), query_adjectives() and set_adjectives()


add_alias
void add_alias(mixed str)

This method adds an alias to the object. An alias for the object is the part used as the main noun for the object. ie in the case of a "green bath tub", "bathtub" might be an alias for the object. and "green" and "bath" would be adjectives. The value set with add_alias is also used with present. This means you can make up an alias for an object that players cannot normaly access but you can get a handle on with present. For an exmple of this look at the money object.

The function takes an array or a string as an argument. If an array is passed in each element of the array is added to the alias array, if it is a string then the string elemnt is added to the array.

Parameters:
str - the alias(s) to add

See also:
set_name(), remove_alias(), set_aliases() and query_alias()

Example:
set_name("tub");
set_short("green bath tub");
add_alias("bathtub");
add_adjective("green");
add_adjective("bath");

add_faux_adjective
void add_faux_adjective(mixed str)

This method adds a faux adjective to the object. Faux adjectives are ignored by objects that ignore identifiers.

The function takes an array or a string as an argument. If an array is passed in each element of the array is added to the faux adjective array, if it is a string then each word in the string element is added to the array. Elements that are already real adjectives of the object are ignored.

See also:
add_adjective(), remove_faux_adjective() and ignore_identifiers()


add_faux_alias
void add_faux_alias(mixed str)

This method adds a faux alias to the object. Faux aliases are ignored by objects that ignore identifiers.

The function takes an array or a string as an argument. If an array is passed in each element of the array is added to the faux alias array, if it is a string then the string element is added to the array. Elements that are already real aliases of the object are ignored. Duplication in this list is allowed; a separate list without duplicates is maintained to improve performance.

Parameters:
str - the alias(s) to add

See also:
query_faux_alias(), query_unique_faux_alias(), add_alias(), add_faux_adjective(), remove_faux_alias(), ignore_identifiers() and parse_command_id_list()

Example:

add_plural
void add_plural(mixed str)

This method adds a plural onto the object. The plurals will be used in plural name matching by thje find_match simul_efun

See also:
/secure/simul_efun->find_match(), set_plurals(), remove_plural(), query_plurals() and add_plurals()


add_plural_adjective
void add_plural_adjective(mixed str)

This method adds an plural adjective to the object. The plural adjectives are used for the object matching routines. Plural adjectives should be used very rarely, they are used in cases where the plural of a name is determined by the adjective rather than it's alias. For example: pair of shoes, pairs of shoes.

See also:
add_alias(), remove_plural_adjective(), query_plural_adjectives() and set_plural_adjectives()


add_plurals
void add_plurals(string * str)

This method adds multiple plurals to the object.

Parameters:
str - the array of plurals to add

See also:
add_plural(), remove_plural() and query_plurals()


faux_id_allowed
int faux_id_allowed()

This method is used by the id function. It determines whether or not an object in the calling list ignores identifiers. If none do, then faux aliases may be used.

Returns:
1 if faux ids may be used

See also:
add_faux_alias.c, add_faux_adjective.c and ignore_identifiers .c


full_id
varargs int full_id(string str,
                    int no_faux)

This checks if the object is fully matched by the supplied string, using both name, aliases and adjectives.

Parameters:
str - The value to check, e.g. "old staff"
no_faux - Do not check for faux aliases or adjectives, stop being fooled by Delusions

Returns:
1 if the string matches

See also:
id(), id_adjective(), id_plural() and id_plural_adjective()


id
varargs int id(string str,
               int no_faux)

This method is used by the present efun. It determines if the passed in string is an alias or the name of the object.

Parameters:
str - the value to check
no_faux - do not check for faux aliases, stop being fooled by delusions

Returns:
1 if the name matches

See also:
full_id(), id_adjective(), id_plural() and id_plural_adjective()


id_adjective
varargs int id_adjective(string word,
                         int no_faux)

This method is similar to the id function, except this will check the adjectives instead of the aliases and the name.

Parameters:
str - the adjective to check
no_faux - Do not check faux adjectives, stop being fooled by Delusions

Returns:
1 if the name matches one of the adjectives, 0 otherwise

See also:
id(), full_id(), id_plural() and id_plural_adjective()


id_plural
int id_plural(string str)

This method is similar to the id function, except this will check the plural names instead of the aliases and the name.

Parameters:
str - the name to check

Returns:
1 if the name matches one of the plurals, 0 otherwise

See also:
id(), full_id(), id_adjective() and id_plural_adjective()


id_plural_adjective
int id_plural_adjective(string word)

This method is similar to the id function, except this will check the plural adjectives instead of the aliases and the name.

Parameters:
str - the name to check

Returns:
1 if the name matches one of the plurals, 0 otherwise

See also:
id(), full_id(), id_adjective() and id_plural()


query_adjectives
varargs string * query_adjectives(int no_faux)

This method returns the current list of adjectives associated with this object. If faux ids are allowed, then faux adjectives are included if the optional parameter is not 1.

Parameters:
no_faux - 1 to ignore faux adjectives

Returns:
the complete list of adjectives


query_alias
varargs string * query_alias(int no_faux)

This method returns the current list of aliases. If faux aliases are allowed, they are included, unless the optional parameter is passed.

Parameters:
no_faux - 1 to ignore faux aliases (optional)

Returns:
the array of aliases (array of strings)

See also:
add_alias(), add_faux_alias(), query_faux_alias(), query_unique_faux_alias() and remove_alias()


query_cap_name
string query_cap_name()

This method returns the capitalized name. It calls the function capitalize() on the name

See also:
query_name(), set_name() and efun::capitalize()


query_faux_adjectives
string * query_faux_adjectives()

This method returns the current list of faux adjectives, including duplicates.

Returns:
the array of faux adjectives (array of strings)

See also:
add_faux_adjective(), remove_faux_adjective(), query_adjectives() and query_unique_faux_adjectives()


query_faux_alias
string * query_faux_alias()

This method returns the current list of faux aliases, with duplicates included.

Returns:
the array of faux aliases (array of strings)

See also:
add_faux_alias(), remove_faux_alias() and query_unique_faux_alias()


query_name
string query_name()

This method returns the name of the object.

Returns:
the name of the object

See also:
set_name(), add_alias() and add_adjective()


query_plural_adjectives
string * query_plural_adjectives()

This method returns the current list of plural adjectives associated with this object.

Returns:
the complete list of plural adjectives


query_plurals
string * query_plurals()

This method returns the complete list of plurals for the object.

Returns:
the complete array of plurals


query_unique_faux_adjectives
string * query_unique_faux_adjectives()

This method returns a unique list of faux adjectives.

Returns:
the array of faux adjectives (array of strings)

See also:
query_adjectives(), id_adjective() and remove_faux_adjective()


query_unique_faux_alias
string * query_unique_faux_alias()

This method returns the unique list of faux aliases. It is this list that id() uses.

Returns:
the array of faux aliases (array of strings) without duplication

See also:
query_faux_alias() and id()


remove_adjective
void remove_adjective(mixed str)

This method will remove an adjective from the object.

Parameters:
str - the adective(s) to remove

See also:
add_alias(), add_adjective() and query_adjectives()


remove_alias
int remove_alias(string str)

This method removes an alias from the object.

Parameters:
str - the alias to remove

Returns:
1 if the alias is found, 0 if not

See also:
add_alias() and query_alias()


remove_faux_adjective
void remove_faux_adjective(mixed str)

This method will remove a faux adjective from the object. Note that, if the adjective has been added more than once, only one instance is removed from the array.

Parameters:
str - the adective(s) to remove

See also:
add_faux_alias(), add_faux_adjective() and query_adjectives()


remove_faux_alias
int remove_faux_alias(string str)

This method removes a faux alias from the object. Note that, if the alias has been added more than once, only one instance is removed from the array. If the last instance of an alias is removed from the list, it is also removed from the unique list.

Parameters:
str - the faux alias to remove

Returns:
1 if the alias is found, 0 if not

See also:
add_faux_alias(), add_faux_adjective(), query_alias() and query_unique_faux_alias()


remove_plural
void remove_plural(string str)

This method removes a plural from the object.

Parameters:
str - the plural to remove

See also:
add_plural(), query_plurals() and set_plurals()


remove_plural_adjective
void remove_plural_adjective(mixed str)

This method will remove an plural adjective from the object.

Parameters:
str - the adective(s) to remove

See also:
add_alias(), add_plural_adjective() and query_plural_adjectives()


set_adjectives
void set_adjectives(string * str)

This method sets all the adjectives for the object. This method should not be used, please use add_adjective instead.

Parameters:
str - the array of adjectives

See also:
add_adjective(), remove_adjective() and query_adjectives()


set_aliases
void set_aliases(string * str)

This method sets the entire alias array. It overrides any current alias definitions and sets the alias arry. This should be used carefully if at all. Use add_alias instead.

Parameters:
str - the new alias array


set_name
void set_name(string str)

This method sets the name of the object. The name is the basic handle used to reference the object. It should not have any spaces in it.

Parameters:
str - the name

See also:
query_name(), add_alias() and add_adjective()

Example:
set_name("rabbit");

set_plural_adjectives
void set_plural_adjectives(string * str)

This method sets all the plural adjectives for the object. This method should not be used, please use add_plural_adjective instead.

Parameters:
str - the array of plural adjectives

See also:
add_plural_adjective(), remove_plural_adjective() and query_plural_adjectives()


set_plurals
void set_plurals(string * str)

This method sets the compete array of plurals. This shod not be used, use add_plural and remove_plural instead.

See also:
add_plural(), remove_plural() and query_plurals()


Classes

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