ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/loader.C
(Generate patch)

Comparing deliantra/server/common/loader.C (file contents):
Revision 1.50 by root, Fri Jan 19 18:06:51 2007 UTC vs.
Revision 1.51 by root, Thu Feb 1 17:29:16 2007 UTC

24 24
25/* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects. 25/* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects.
26 sub/add_weight will transcend the environment updating the carrying 26 sub/add_weight will transcend the environment updating the carrying
27 variable. */ 27 variable. */
28 28
29
30#include <global.h> 29#include <global.h>
31#include <loader.h> 30#include <loader.h>
32#include <sproto.h> 31#include <sproto.h>
33 32
34// future resource loader base class 33// resource loader pure base class
35struct loader_base 34struct loader_base
36{ 35{
37 const char *filename; 36 const char *filename;
38 virtual const char *type () const = 0; 37 virtual const char *type () const = 0;
39 38
57 56
58 virtual animation *get_animation (const char *name); 57 virtual animation *get_animation (const char *name);
59 virtual void put_animation (animation *anim); 58 virtual void put_animation (animation *anim);
60}; 59};
61 60
61// pure base class for default archetype loader
62struct loader_arch : virtual loader_base {
63 archetype *get_arch (const char *name);
64 void put_arch (archetype *arch);
65};
66
67// pure base class for default object loader
68struct loader_object : virtual loader_base {
69 object *get_object (const char *name);
70 void put_object (object *op);
71};
72
73// pure base class for default player loader
74struct loader_player : virtual loader_base {
75 virtual player *get_player ();
76 virtual void put_player (player *pl);
77};
78
79// pure base class for default region loader
80struct loader_region : virtual loader_base {
81 region *get_region ();
82 void put_region (region *region);
83};
84
85// pure base class for default face loader
86struct loader_face : virtual loader_base {
87 facetile *get_face (const char *name);
88 void put_face (facetile *face);
89};
90
91// pure base class for default treasure loader
92struct loader_treasure : virtual loader_base {
93 treasurelist *get_treasure (const char *name, bool one = false);
94 void put_treasure (treasurelist *treasure);
95};
96
97// pure base class for default animation loader
98struct loader_animation : virtual loader_base {
99 animation *get_animation (const char *name);
100 void put_animation (animation *anim);
101};
102
62// future generic resource loader 103// future generic resource loader
63// handles generic stuff valid in most files, such as 104// handles generic stuff valid in most files, such as
64// animations, treasures, faces and so on 105// animations, treasures, faces and so on
65struct loader_generic : loader_base 106struct loader_generic
107: virtual loader_base,
108 loader_object, loader_player,
109 loader_region, loader_face,
110 loader_treasure, loader_animation
66{ 111{
67 const char *type () const = 0; 112 const char *type () const = 0;
68
69 region *get_region ();
70 void put_region (region *region);
71
72 facetile *get_face (const char *name);
73 void put_face (facetile *face);
74
75 treasurelist *get_treasure (const char *name, bool one = false);
76 void put_treasure (treasurelist *treasure);
77
78 animation *get_animation (const char *name);
79 void put_animation (animation *anim);
80}; 113};
81 114
82// the base class warns about and skips everything 115// the base class warns about and skips everything
83archetype * 116archetype *
84loader_base::get_arch (const char *name) 117loader_base::get_arch (const char *name)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines