Crossfire Server, Trunk  R20513
Functions | Variables
ob_types.c File Reference

Those functions deal with the object/type system. More...

#include <global.h>
#include <ob_types.h>
#include <ob_methods.h>
#include <sproto.h>
Include dependency graph for ob_types.c:

Go to the source code of this file.

Functions

void init_ob_method_struct (ob_methods *methods, ob_methods *fallback)
 Initializes a ob_methods struct. More...
 
void init_ob_types (ob_methods *base_type)
 Initializes the object system. More...
 
void register_apply (int ob_type, apply_func method)
 Registers the apply method for the given type. More...
 
void register_describe (int ob_type, describe_func method)
 Registers the describe method for the given type. More...
 
void register_move_on (int ob_type, move_on_func method)
 Registers the move_on method for the given type. More...
 
void register_process (int ob_type, process_func method)
 Registers the process method for the given type. More...
 
void register_trigger (int ob_type, trigger_func method)
 Registers the trigger method for the given type. More...
 

Variables

ob_methods type_methods [OBJECT_TYPE_MAX]
 Registered method handlers. More...
 

Detailed Description

Those functions deal with the object/type system.

Definition in file ob_types.c.

Function Documentation

void init_ob_method_struct ( ob_methods methods,
ob_methods fallback 
)

Initializes a ob_methods struct.

Make sure this always matches ob_methods.h

Parameters
methodsob_method structure to initialize
fallbackDefault fallback for the ob_method

Definition at line 32 of file ob_types.c.

References ob_methods::apply, ob_methods::describe, ob_methods::fallback, ob_methods::move_on, ob_methods::process, and ob_methods::trigger.

Referenced by init_ob_methods(), and init_ob_types().

Here is the caller graph for this function:

void init_ob_types ( ob_methods base_type)

Initializes the object system.

Parameters
base_typebase type to use as a base for all types.
Todo:
when migration is complete, the parameter should go, and this function should be called from init_library() instead of init_ob_methods() in server/ob_methods.c.

Definition at line 49 of file ob_types.c.

References init_ob_method_struct(), and OBJECT_TYPE_MAX.

Referenced by init_ob_methods().

Here is the call graph for this function:

Here is the caller graph for this function:

void register_apply ( int  ob_type,
apply_func  method 
)
void register_describe ( int  ob_type,
describe_func  method 
)

Registers the describe method for the given type.

Parameters
ob_typeThe type of object to register this method to
methodThe method to link

Definition at line 80 of file ob_types.c.

References ob_methods::describe.

Referenced by init_type_power_crystal().

Here is the caller graph for this function:

void register_move_on ( int  ob_type,
move_on_func  method 
)
void register_process ( int  ob_type,
process_func  method 
)

Registers the process method for the given type.

Parameters
ob_typeThe type of object to register this method to
methodThe method to link

Definition at line 71 of file ob_types.c.

References ob_methods::process.

Referenced by init_type_arrow(), init_type_blindness(), init_type_creator(), init_type_deep_swamp(), init_type_detector(), init_type_gate(), init_type_marker(), init_type_mood_floor(), init_type_peacemaker(), init_type_player_changer(), init_type_poisoning(), init_type_rune(), init_type_spell_effect(), init_type_teleporter(), init_type_thrown_object(), init_type_transport(), init_type_trap(), and init_type_trigger().

Here is the caller graph for this function:

void register_trigger ( int  ob_type,
trigger_func  method 
)

Registers the trigger method for the given type.

Parameters
ob_typeThe type of object to register this method to
methodThe method to link

Definition at line 98 of file ob_types.c.

References ob_methods::trigger.

Referenced by init_type_creator(), init_type_duplicator(), init_type_marker(), init_type_mood_floor(), and init_type_teleporter().

Here is the caller graph for this function:

Variable Documentation

ob_methods type_methods[OBJECT_TYPE_MAX]

Registered method handlers.

Definition at line 25 of file ob_types.c.

Referenced by ob_apply(), ob_describe(), ob_move_on(), ob_process(), and ob_trigger().