Crossfire Server, Trunk
ob_methods.h File Reference

Go to the source code of this file.

Data Structures

struct  ob_methods
 

Macros

#define METHOD_ERROR   2
 
#define METHOD_OK   0
 
#define METHOD_SILENT_ERROR   3
 
#define METHOD_UNHANDLED   1
 

Typedefs

typedef method_ret(* apply_func) (object *, object *, int)
 
typedef void(* describe_func) (const object *, const object *, int use_media_tags, char *buf, size_t size)
 
typedef char method_ret
 
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

#define METHOD_ERROR   2

Definition at line 17 of file ob_methods.h.

◆ METHOD_OK

#define METHOD_OK   0

Definition at line 15 of file ob_methods.h.

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

◆ METHOD_UNHANDLED

#define METHOD_UNHANDLED   1

Definition at line 16 of file ob_methods.h.

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.

◆ 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 33 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 34 of file ob_methods.h.