Crossfire Server, Branches 1.12  R18729
ob_methods.h
Go to the documentation of this file.
1 /*
2  * static char *rcsid_ob_methods_h =
3  * "$Id: define.h 4998 2006-10-06 18:27:07Z qal21 $";
4  */
5 /*
6  CrossFire, A Multiplayer game for X-windows
7 
8  Copyright (C) 2006 Mark Wedel & Crossfire Development Team
9  Copyright (C) 1992 Frank Tore Johansen
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 
25  The authors can be reached via e-mail at crossfire-devel@real-time.com
26 */
27 
33 #ifndef OB_METHODS_H
34 #define OB_METHODS_H
35 
41 typedef char method_ret;
42 #define METHOD_OK 0
43 #define METHOD_UNHANDLED 1
44 #define METHOD_ERROR 2
45 #define METHOD_SILENT_ERROR 3
53 /* Example:
54  * typedef method_ret (apply_func)(ob_methods *context, object *ob);
55  */
56 
65 typedef struct ob_methods ob_methods;
66 typedef method_ret (*apply_func)(ob_methods *, object *, object *, int);
67 typedef method_ret (*process_func)(ob_methods *, object *);
68 typedef void (*describe_func)(const ob_methods *, const object *, const object *, char *buf, size_t size);
69 typedef method_ret (*move_on_func)(ob_methods *, object *, object *, object *);
70 typedef method_ret (*trigger_func)(ob_methods *, object *, object *, int);
71 
72 struct ob_methods {
78  struct ob_methods *fallback;
79  /* Example:
80  * apply_func *apply;
81  */
82 };
83 
84 #endif /* OB_METHODS_H */
method_ret(* process_func)(ob_methods *, object *)
Definition: ob_methods.h:67
method_ret(* move_on_func)(ob_methods *, object *, object *, object *)
Definition: ob_methods.h:69
struct ob_methods * fallback
Definition: ob_methods.h:78
apply_func apply
Definition: ob_methods.h:73
char method_ret
Definition: ob_methods.h:41
method_ret(* trigger_func)(ob_methods *, object *, object *, int)
Definition: ob_methods.h:70
move_on_func move_on
Definition: ob_methods.h:76
void(* describe_func)(const ob_methods *, const object *, const object *, char *buf, size_t size)
Definition: ob_methods.h:68
trigger_func trigger
Definition: ob_methods.h:77
process_func process
Definition: ob_methods.h:74
method_ret(* apply_func)(ob_methods *, object *, object *, int)
Definition: ob_methods.h:66
describe_func describe
Definition: ob_methods.h:75