/[enigma]/enigma/src/objects.hh
ViewVC logotype

Diff of /enigma/src/objects.hh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by dheck, Thu Jan 9 18:32:38 2003 UTC revision 1.4 by dheck, Sun Jan 12 19:40:44 2003 UTC
# Line 26  Line 26 
26    
27  #include "px/pxfwd.hh"  #include "px/pxfwd.hh"
28  #include "px/math.hh"  #include "px/math.hh"
 // #include "px/dict.hh"  
29  #include "px/alist.hh"  #include "px/alist.hh"
30    
31  #include <string>  #include <string>
# Line 70  namespace world Line 69  namespace world
69          Object(const char *kind);          Object(const char *kind);
70          virtual ~Object() {}          virtual ~Object() {}
71    
72            bool string_attrib (const string &name, string *val) const;
73            int  int_attrib (const string &name) const;
74            bool int_attrib (const string &name, int *val) const;
75            bool double_attrib (const string &name, double *val) const;
76    
77            const char *get_kind() const;
78    
79          // Object interface          // Object interface
80          virtual void message(const string& msg, const Value &val) {}          virtual void message(const string& msg, const Value &val);
81          virtual void set_attrib(const string& key, const Value &val);          virtual void set_attrib(const string& key, const Value &val);
82          virtual const Value* get_attrib(const string& key) const;          virtual const Value* get_attrib(const string& key) const;
83    
         bool string_attrib(const string &name, string *val) const;  
         int int_attrib(const string &name) const;  
         bool int_attrib(const string &name, int *val) const;  
         bool double_attrib (const string &name, double *val) const;  
   
84          virtual Object *clone()=0;          virtual Object *clone()=0;
85          virtual void dispose()=0;          virtual void dispose()=0;
86          virtual void init() {}          virtual void init() {}
87    
88          virtual const ObjectTraits *get_traits() const { return 0; }          virtual const ObjectTraits *get_traits() const { return 0; }
           
         const char *get_kind() const;  
89      private:      private:
90          typedef px::AList<std::string, Value> AttribMap;          typedef px::AssocList<std::string, Value> AttribMap;
91          AttribMap attribs;          AttribMap attribs;
92      };      };
93  }  }
# Line 96  namespace world Line 95  namespace world
95    
96  /*  /*
97   * GridObject is the base class for everything that can only be placed   * GridObject is the base class for everything that can only be placed
98   * on "The Grid".   * on "The Grid", i.e., for floor tiles, items, and stones.
99   */   */
100  namespace world  namespace world
101  {  {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26