[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/clothing_handler.c

This object handles all the different types of clothing, their locations etc.

Written by Pinkfish

Includes

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

Method index

Public Functions

These are functions that everyone can access.

can_wear_or_remove
string can_wear_or_remove(object thing,
                          object player)

This method returns whether or not a player can wear or remove a given item.

Parameters:
thing - the item to be worn or removed.
player - the person doing the wearing or removing.

Returns:
0 for success, a string for failure.


query_all_clothing_types
mapping query_all_clothing_types()

This method returns a mapping of the current clothing types.

The make up of this array is:

first element
is the items which if you're wearing this one cannot be removed. second element
is the items which hide the given item.
i.e. The wig type cannot be removed if types hood, helmet or hat are also worn, also the wig type is not visible if the types hood, helmet or hat are worn.

Returns:
the mapping of clothing types

See also:
add_clothing_type()


query_all_clothing_zones
mapping query_all_clothing_zones()

This method returns the clothing zones. The mapping consists of arrays of types which are in the particular zones.

Returns:
the clothing zones


query_all_equivalent_types
mapping query_all_equivalent_types()

This method returns all the equivalent types.

Returns:
the equivalent types


query_all_equivilant_types
mapping query_all_equivilant_types()
query_clothing_cannot_remove
string * query_clothing_cannot_remove(string type)

This method returns the items you would be unable to remove the type with.

Parameters:
type - the type of clothing to check

Returns:
array of types you would be unable to remove, 0 if invalid type

See also:
query_clothing_hiding() and query_clothing_depth()


query_clothing_depth
int query_clothing_depth(mixed type)

This method returns the depth of the clothing type. The parament can also be an array, in which case it will return the minimum non-zero depth.

Parameters:
type - the type of clothing to check

Returns:
the depth rating of the type

See also:
query_clothing_cannot_remove() and query_clothing_hiding()


query_clothing_hiding
string * query_clothing_hiding(string type)

This method returns the types which hide this type of thingy.

Parameters:
type - the type of clothing to check

Returns:
array of types which would hide this type, 0 if invalid type

See also:
query_clothing_cannot_remove() and query_clothing_depth()


query_clothing_maximum_depth
int query_clothing_maximum_depth(mixed type)

This method returns the depth of the clothing type. The parament can also be an array, in which case it will return the maximum non-zero depth.

Parameters:
type - the type of clothing to check

Returns:
the depth rating of the type

See also:
query_clothing_cannot_remove() and query_clothing_hiding()


query_clothing_type
class clothing_type query_clothing_type(string name)

This method returns the information associated with the clothing of a particular type.

This will returns a class containing the clothing type information in it.

Parameters:
name - the name of the type to lookup

Returns:
the clothing type array, 0 if not found

See also:
query_clothing_cannot_remove() and query_clothing_cannot_remove()


query_clothing_zone
string * query_clothing_zone(string zone)

This method returns the array of clothing types in the particular zone.

Parameters:
zone - the zone to get the types for

Returns:
the clothing in the current zone


query_equivalent_race
string query_equivalent_race(string race)

This method returns the primary race that is the same size as the race queried.

Parameters:
race - the race name to check

Returns:
the standard race size.


query_equivalent_type
string query_equivalent_type(string type)

This method returns the equivalent type for the given type.

Parameters:
type - the type to get the equivalent fo

Returns:
the equivalent type


query_equivilant_race
string query_equivilant_race(string race)
query_equivilant_type
string query_equivilant_type(string type)
query_items_blocking
object * query_items_blocking(object thing,
                              object player)

This method returns the list of things that are blocking the removal of the specific object.

Parameters:
thing - the thing to find what it is being blocked by
player - the player to look it up on

Returns:
the array of objects blocking it


query_no_temp
string * query_no_temp()

This method returns a list of clothing types that should have no impact on a persons temperature.
query_valid_type
int query_valid_type(string type)

This method tells us if the type is valid. It checks both normal types and equivalent types.

Parameters:
type - the type to check

Returns:
1 if it is valid, 0 if not


query_zone_level
int query_zone_level(string zone)

This method returns the level for the specified zone.

Parameters:
zone - the zone to check

Returns:
the level of the zone


query_zone_levels
string * query_zone_levels()

This method returns an array of all the zones

Returns:
array of all the zones


query_zone_name
string query_zone_name(string type)

This method finds the zone for the specific type.

Parameters:
type - the type to find in the zones

Returns:
the zone name, 0 if not found


query_zone_names
string * query_zone_names(string type)

This method finds all the zones for the specific type.

Parameters:
type - the type to find in the zones

Returns:
the zone names, 0 if not found


Protected Functions

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

add_clothing_type
void add_clothing_type(string name,
                       string * not_remove,
                       string * hiding,
                       int length,
                       int width)

This method adds a new clothing type into the existing clothing type mapping.

Parameters:
name - the name of the clothing type
not_remove - the types which if worn you cannot remove this item
hiding - the types which hides this clothing


add_clothing_zone
void add_clothing_zone(string zone,
                       string * types)

This method adds a clothing zone.

Parameters:
zone - the zone name
types - the types to add to the zone


add_equivalent_race
void add_equivalent_race(string race,
                         string equiv)

This method adds an equivalent race.

Parameters:
equiv - the race it is equivalent in size & clothing requirements to.


add_equivalent_type
void add_equivalent_type(string name,
                         string equiv)

This method adds an equivalent type.

Parameters:
name - the name of the type
equiv - what it is equivalent to


add_equivilant_race
void add_equivilant_race(string race,
                         string equiv)
add_equivilant_type
void add_equivilant_type(string name,
                         string equiv)
add_zone_coverage
void add_zone_coverage(string type,
                       string * zones)

This method sets the zones that a particular clothing type covers

Parameters:
type - the clothing type