Crossfire Server  1.75.0
ob_methods.h File Reference

Object type functions and variables. More...

Go to the source code of this file.

Data Structures

struct  ob_methods
 This struct stores function pointers for actions that can be done to objects. More...
 

Macros

#define METHOD_ERROR   2
 
#define METHOD_OK   0
 
#define METHOD_SILENT_ERROR   3
 Player was warned she can't use the item for now. More...
 
#define METHOD_UNHANDLED   1
 

Typedefs

typedef method_ret(* apply_func) (object *, object *, int)
 Typedefs for ob_methods. More...
 
typedef void(* describe_func) (const object *, const object *, int use_media_tags, char *buf, size_t size)
 
typedef method_ret(* examine_func) (const object *, const object *, int use_media_tags, char *buf, size_t size)
 
typedef char method_ret
 Define some standard return values for callbacks which don't need to return any other results. More...
 
typedef method_ret(* move_on_func) (object *, object *, object *)
 
typedef method_ret(* process_func) (object *)
 
typedef method_ret(* trigger_func) (object *, object *, int)
 

Detailed Description

Object type functions and variables.

Definition in file ob_methods.h.

Macro Definition Documentation

◆ METHOD_ERROR

◆ METHOD_OK

#define METHOD_OK   0

Definition at line 15 of file ob_methods.h.

Referenced by altar_type_move_on(), apply_by_living(), apply_by_living_below(), armour_improver_type_apply(), arrow_type_process(), blindness_type_process(), book_type_apply(), button_type_move_on(), cf_handle_type_apply(), check_inv_type_move_on(), clock_type_apply(), close_container_apply(), common_pre_ob_move_on(), common_process_projectile(), common_projectile_move_on(), common_trap_type_move_on(), common_trap_type_process(), container_apply(), container_examine(), container_type_move_on(), converter_type_apply(), converter_type_move_on(), creator_type_process(), creator_type_trigger(), deep_swamp_type_move_on(), deep_swamp_type_process(), detector_type_process(), director_process(), director_type_move_on(), duplicator_type_trigger(), exit_type_apply(), exit_type_move_on(), food_type_apply(), gate_type_process(), hole_type_move_on(), identify_altar_type_move_on(), lamp_type_apply(), legacy_ob_apply(), legacy_ob_process(), lightable_type_apply(), lighter_type_apply(), lighter_type_examine(), marker_type_process(), marker_type_trigger(), mimic_type_apply(), mood_floor_type_process(), mood_floor_type_trigger(), ob_apply(), peacemaker_type_process(), pedestal_type_move_on(), player_changer_type_process(), player_mover_type_move_on(), poison_type_apply(), poisoning_type_process(), potion_type_apply(), power_crystal_type_apply(), savebed_type_apply(), scroll_type_apply(), shop_inventory_type_apply(), shop_mat_type_move_on(), sign_type_apply(), sign_type_move_on(), skillscroll_type_apply(), spell_effect_type_move_on(), spell_effect_type_process(), spellbook_type_apply(), spinner_type_move_on(), teleporter_type_process(), teleporter_type_trigger(), thrown_object_type_process(), timed_gate_type_process(), transport_type_apply(), trapdoor_type_move_on(), treasure_type_apply(), trigger_altar_type_move_on(), trigger_button_type_move_on(), trigger_pedestal_type_move_on(), trigger_type_process(), and weapon_improver_type_apply().

◆ METHOD_SILENT_ERROR

#define METHOD_SILENT_ERROR   3

Player was warned she can't use the item for now.

Definition at line 18 of file ob_methods.h.

Referenced by apply_by_living(), apply_manual(), and transport_type_apply().

◆ METHOD_UNHANDLED

Typedef Documentation

◆ apply_func

typedef method_ret(* apply_func) (object *, object *, int)

Typedefs for ob_methods.

Also used in ob_types.c for storing the pointers temporarily. As a convention, callbacks parameters should begin with "ob_methods *context, object *ob", and return method_ret unless it needs to return something else.

Definition at line 30 of file ob_methods.h.

◆ describe_func

typedef void(* describe_func) (const object *, const object *, int use_media_tags, char *buf, size_t size)

Definition at line 32 of file ob_methods.h.

◆ examine_func

typedef method_ret(* examine_func) (const object *, const object *, int use_media_tags, char *buf, size_t size)

Definition at line 33 of file ob_methods.h.

◆ method_ret

typedef char method_ret

Define some standard return values for callbacks which don't need to return any other results.

Later this might be expanded into a more complex return value system if necessary

Definition at line 14 of file ob_methods.h.

◆ move_on_func

typedef method_ret(* move_on_func) (object *, object *, object *)

Definition at line 34 of file ob_methods.h.

◆ process_func

typedef method_ret(* process_func) (object *)

Definition at line 31 of file ob_methods.h.

◆ trigger_func

typedef method_ret(* trigger_func) (object *, object *, int)

Definition at line 35 of file ob_methods.h.