/[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.10 by dheck, Thu Mar 13 18:07:39 2003 UTC revision 1.11 by dheck, Sun Mar 23 17:36:42 2003 UTC
# Line 52  namespace world Line 52  namespace world
52      using std::string;      using std::string;
53      using namespace enigma;      using namespace enigma;
54    
55      enum ObjectFlag {  
56          OBJF_NOTIFY_CREATION,      enum ObjectType {
57            OBJTYPE_None,
58            OBJTYPE_Floor,
59            OBJTYPE_Item,
60            OBJTYPE_Stone,
61            OBJTYPE_Actor
62        };
63    
64        enum Signals {
65            SIGNAL_None      = 0,
66            SIGNAL_Trigger   = 0x01,
67            SIGNAL_Open      = 0x02,
68            SIGNAL_Close     = 0x04,
69            SIGNAL_OpenClose = 0x08,
70            SIGNAL_On        = 0x10,
71            SIGNAL_Off       = 0x20,
72            SIGNAL_OnOff     = 0x40,
73      };      };
74    
75    
76      struct ObjectTraits {      struct ObjectTraits {
77          const char *kind;          ObjectTraits ()
78          const char *modelname;          : type (OBJTYPE_None), signals_out (SIGNAL_None),
79          int flags;            signals_in(SIGNAL_None), min_version (0.0)
80            {}
81    
82            ObjectTraits (const std::string &name_,
83    //                       const std::string &short_text_,
84    //                       const std::string &long_text_,
85                          ObjectType type_)
86            : name(name_),
87    //           short_text(short_text_),
88    //           long_text(long_text_),
89              type(type_),
90              signals_out (SIGNAL_None),
91              signals_in (SIGNAL_None),
92              min_version (0.0)
93            {}
94    
95            string      name;
96            string      short_text;
97            string      long_text;
98            ObjectType  type;
99            Signals     signals_out;
100            Signals     signals_in;
101            float       min_version; // Required Enigma version
102      };      };
103        
104      class Object {      class Object {
105      public:      public:
106          Object() {}          Object() {}
# Line 315  namespace world Line 355  namespace world
355    
356          const display::SpriteHandle &get_sprite() const { return m_sprite; }          const display::SpriteHandle &get_sprite() const { return m_sprite; }
357    
358            void set_attrib(const string &key, const Value &val);
359    
360    
361      protected:      protected:
362          Actor(const char *name, const px::V2 &pos);          Actor(const char *name, const px::V2 &pos);
363    
364          void set_model(const string &mname, const px::V2 &pos);          void set_model(const string &mname, const px::V2 &pos);
365          void set_model(const string &mname);          void set_model(const string &mname);
         void set_attrib(const string &key, const Value &val);  
366    
367      private:      private:
368    
# Line 347  namespace world Line 389  namespace world
389      Floor  *MakeFloor (const char *kind);      Floor  *MakeFloor (const char *kind);
390      Item   *MakeItem (const char *kind);      Item   *MakeItem (const char *kind);
391      Stone  *MakeStone (const char *kind);      Stone  *MakeStone (const char *kind);
392        Actor  *MakeActor (const char *kind);
393    
394      void DisposeObject(Object *o);      void DisposeObject(Object *o);
395    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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