[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/room_handler.c

This file contains all the bits needed to handle rooms, plus the code to handle following when moving.

See also:
/std/room/basic_room.c

Written by Pinkfish

Includes

This class includes the following files /include/room.h, /include/tasks.h, /include/living.h, /include/position.h, /include/weather.h, /include/dirs.h, /include/climate.h, /include/move_failures.h, /include/playtesters.h and /include/player.h

Method index

Public Functions

These are functions that everyone can access.

add_chatter
void add_chatter(object thing,
                 int number)
add_door
void add_door(object thing)
add_exit_type
int add_exit_type(string type,
                  mixed message,
                  mixed obvious,
                  int size,
                  mixed func)

This method adds an exit type to the current list of available exit types. This is used when the room handler is setup to add all the used exit types.

Parameters:
type - the name of the exit type
message - the message to display when going through the exit
obvious - if the exit is obvious or not
size - the size of the exit (used for heigh restrictions)
func - the function to call when using the exit

Returns:
1 if successfuly added, 0 if not

See also:
remove_exit_type()


check_chatters
void check_chatters()
check_door
void check_door(mixed args)

This method checks to see if the door exists or not. It is passed in the room we are going from and the direction the exit faces in the array.
({ room_from, direction })

This is the function which generates those door xx not found messages.

Parameters:
args - the arguements passed into the function

See also:
query_door_type()


check_doors
void check_doors()
do_follow
object do_follow(object follower,
                 object thing,
                 mixed special,
                 string verb,
                 mixed * dest_other,
                 mixed closed,
                 mixed func,
                 object place,
                 int skill_based,
                 int light_level,
                 object original_place)

This is called by exit_move() to do the checks and so forth for each follower.
exit_move
int exit_move(string verb,
              string extra,
              mixed special,
              object thing,
              object original_place)

This is the main code for moving someone. The move_thing code above should not be called directly. This code handlers all the followers and any other things that need to be handled.

Parameters:
verb - the movement verb
extra - extra information
special - special informaiton
thing - the thing to move

Returns:
1 on success, 0 on failure


housekeeping
void housekeeping()
move_thing
int move_thing(object thing,
               string dir,
               string dest,
               mixed exit,
               mixed enter,
               string move)

THis is the code that actually moves the thing around the place. It handles all the weirdness involved with dragging things and other such stuff.

Parameters:
thing - what is being moved
dir - the direction we are going
dest - the destionation room
exit - the exit name
enter - the enter name
move - the string to tell the object when it moves

Returns:
1 on success, 0 on failure


query_chatters
mixed * query_chatters()

This method returns the current list of rooms that are enabled for chatting.

Returns:
the current chatters


query_door_type
mixed * query_door_type(string type,
                        string direc,
                        string dest)

This method returns information about the door type, the door has extra information associated with it than the standard exit type. This function does a double job of trying to find the corresponding door on the other side of the room.

Parameters:
type - the type of the door
direc - the direction the door points
dest - the destination of the door

Returns:
the door type array of information


query_doors
mixed * query_doors()

This method returns the current list of doors handled by the room handler.

Returns:
the current array of doors


query_exit_type
mixed * query_exit_type(string type,
                        string dir)

This method returns the information associated with the exit type.

Parameters:
type - the exit type to query
dir - the direction the type information is for

Returns:
a huge amount of info as specified above


query_opposite_direction
string query_opposite_direction(string dir)

This method returns the opposite direction to this exit. This should only be used for printing, since it is not a useful real name.

Parameters:
dir - the direction to get the opposite of

Returns:
the opposite direction


remove_exit_type
int remove_exit_type(string type)

This method remove the named exit from the type list.

Parameters:
type - the name of the exit type to remove

Returns:
always returns 1

See also:
add_exit_type()