Crossfire Server, Trunk
ob_methods.cpp
Go to the documentation of this file.
1
/*
2
* Crossfire -- cooperative multi-player graphical RPG and adventure game
3
*
4
* Copyright (c) 1999-2014 Mark Wedel and the Crossfire Development Team
5
* Copyright (c) 1992 Frank Tore Johansen
6
*
7
* Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
8
* welcome to redistribute it under certain conditions. For details, please
9
* see COPYING and LICENSE.
10
*
11
* The authors can be reached via e-mail at <crossfire@metalforge.org>.
12
*/
13
19
#include <
global.h
>
20
#include <
ob_methods.h
>
21
#include <
ob_types.h
>
22
23
#ifndef __CEXTRACT__
24
#include <
sproto.h
>
25
#endif
26
27
static
ob_methods
base_type
;
28
29
static
ob_methods
legacy_type
;
30
35
void
init_ob_methods
(
void
) {
36
/* Init legacy_type. Note, this is just used as a transitionary fallback
37
* until refactoring of type-specific code is complete, and when it is this
38
* ob_methods struct should be removed.
39
*/
40
init_ob_method_struct
(&
legacy_type
, NULL);
41
legacy_type
.
apply
=
legacy_ob_apply
;
42
legacy_type
.
process
=
legacy_ob_process
;
43
legacy_type
.
describe
=
legacy_ob_describe
;
44
legacy_type
.
move_on
= NULL;
45
46
/* Init base_type, inheriting from legacy_type. The base_type is susposed to
47
* be a base class of object that all other object types inherit methods
48
* they don't handle individually. Things such as generic drop/pickup code
49
* should go here, in addition some other things such as "I don't know how
50
* to apply that." messages should be handled from here.
51
*/
52
init_ob_method_struct
(&
base_type
, &
legacy_type
);
53
/* base_type.foobar = common_ob_foobar; */
54
55
/* Init object types methods, inheriting from base_type. */
56
init_ob_types
(&
base_type
);
57
register_all_ob_types
();
58
}
global.h
ob_methods::move_on
move_on_func move_on
Definition:
ob_methods.h:47
legacy_ob_describe
void legacy_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Definition:
legacy_describe.cpp:39
legacy_type
static ob_methods legacy_type
Definition:
ob_methods.cpp:29
init_ob_types
void init_ob_types(ob_methods *base_type)
Definition:
ob_types.cpp:49
ob_methods::apply
apply_func apply
Definition:
ob_methods.h:44
ob_methods
Definition:
ob_methods.h:43
sproto.h
ob_methods::describe
describe_func describe
Definition:
ob_methods.h:46
ob_types.h
ob_methods::process
process_func process
Definition:
ob_methods.h:45
base_type
static ob_methods base_type
Definition:
ob_methods.cpp:27
legacy_ob_apply
method_ret legacy_ob_apply(object *op, object *applier, int aflags)
Definition:
apply.cpp:49
register_all_ob_types
void register_all_ob_types(void)
Definition:
ob_types.cpp:31
init_ob_method_struct
void init_ob_method_struct(ob_methods *methods, ob_methods *fallback)
Definition:
ob_types.cpp:32
ob_methods.h
init_ob_methods
void init_ob_methods(void)
Definition:
ob_methods.cpp:35
legacy_ob_process
method_ret legacy_ob_process(object *op)
Definition:
process.cpp:31
crossfire-crossfire-server
server
ob_methods.cpp
Generated by
1.8.17