Crossfire Server, Trunk
ob_types.cpp File Reference
#include <global.h>
#include <ob_types.h>
#include <ob_methods.h>
#include <sproto.h>
+ Include dependency graph for ob_types.cpp:

Go to the source code of this file.

Functions

void init_ob_method_struct (ob_methods *methods, ob_methods *fallback)
 
void init_ob_types (ob_methods *base_type)
 
void register_apply (int ob_type, apply_func method)
 
void register_describe (int ob_type, describe_func method)
 
void register_move_on (int ob_type, move_on_func method)
 
void register_process (int ob_type, process_func method)
 
void register_trigger (int ob_type, trigger_func method)
 

Variables

ob_methods type_methods [OBJECT_TYPE_MAX]
 

Detailed Description

Those functions deal with the object/type system.

Definition in file ob_types.cpp.

Function Documentation

◆ init_ob_method_struct()

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.cpp.

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:

◆ init_ob_types()

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.cpp.

References base_type, init_ob_method_struct(), OBJECT_TYPE_MAX, Ice::tmp, and type_methods.

Referenced by init_ob_methods().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ register_apply()

◆ register_describe()

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.cpp.

References ob_methods::describe, and type_methods.

Referenced by init_type_lamp(), init_type_power_crystal(), and init_type_spellbook().

+ Here is the caller graph for this function:

◆ register_move_on()

◆ register_process()

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.cpp.

References ob_methods::process, and type_methods.

Referenced by init_type_arrow(), init_type_blindness(), init_type_creator(), init_type_deep_swamp(), init_type_detector(), init_type_director(), 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:

◆ register_trigger()

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.cpp.

References ob_methods::trigger, and type_methods.

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

◆ type_methods