Crossfire Server, Branch 1.12
R12190
|
00001 /* 00002 * static char *rcsid_ob_methods_h = 00003 * "$Id: define.h 4998 2006-10-06 18:27:07Z qal21 $"; 00004 */ 00005 /* 00006 CrossFire, A Multiplayer game for X-windows 00007 00008 Copyright (C) 2006 Mark Wedel & Crossfire Development Team 00009 Copyright (C) 1992 Frank Tore Johansen 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with this program; if not, write to the Free Software 00023 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 00025 The authors can be reached via e-mail at crossfire-devel@real-time.com 00026 */ 00027 00033 #ifndef OB_METHODS_H 00034 #define OB_METHODS_H 00035 00041 typedef char method_ret; 00042 #define METHOD_OK 0 00043 #define METHOD_UNHANDLED 1 00044 #define METHOD_ERROR 2 00045 #define METHOD_SILENT_ERROR 3 00053 /* Example: 00054 * typedef method_ret (apply_func)(ob_methods *context, object *ob); 00055 */ 00056 00065 typedef struct ob_methods ob_methods; 00066 typedef method_ret (*apply_func)(ob_methods *, object *, object *, int); 00067 typedef method_ret (*process_func)(ob_methods *, object *); 00068 typedef void (*describe_func)(const ob_methods *, const object *, const object *, char *buf, size_t size); 00069 typedef method_ret (*move_on_func)(ob_methods *, object *, object *, object *); 00070 typedef method_ret (*trigger_func)(ob_methods *, object *, object *, int); 00071 00072 struct ob_methods { 00073 apply_func apply; 00074 process_func process; 00075 describe_func describe; 00076 move_on_func move_on; 00077 trigger_func trigger; 00078 struct ob_methods *fallback; 00079 /* Example: 00080 * apply_func *apply; 00081 */ 00082 }; 00083 00084 #endif /* OB_METHODS_H */