/[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.16 by reallysoft, Sun May 4 18:24:18 2003 UTC revision 1.17 by dheck, Wed May 7 20:40:12 2003 UTC
# Line 210  namespace world Line 210  namespace world
210  //  //
211  namespace world  namespace world
212  {  {
213      struct FloorTraits {      enum FloorFlags {
214          double friction;          FLOOR_CanCrack = 0x01,
215          double mousefactor;          FLOOR_ItemsAllowed = 0x02,
216    
217            FLOOR_Normal = FLOOR_CanCrack | FLOOR_ItemsAllowed
218      };      };
219    
220        struct FloorTraits {
221            FloorTraits (const char *n, double f, double m, FloorFlags fl)
222            { name = n; friction = f; mousefactor = m; flags = fl; }
223    
224            const char *name;
225            double      friction;
226            double      mousefactor;
227            FloorFlags  flags;
228         };
229    
230      class Floor : public TGridObject<GRID_FLOOR> {      class Floor : public TGridObject<GRID_FLOOR> {
231      public:      public:
232          Floor(const char *kind, double friction, double mfactor);          Floor (const FloorTraits &tr);
233            Floor (const char *kind, double friction, double mfactor);
234    
235          // Object interface          // Object interface
236          Floor *clone();          Floor *clone();
# Line 236  namespace world Line 249  namespace world
249    
250          void actor_hit(Actor *a) { on_actorhit(a); }          void actor_hit(Actor *a) { on_actorhit(a); }
251    
252          double friction() const { return _friction; }          double friction() const { return traits.friction; }
253          double mousefactor() const { return _mousefactor; }          double mousefactor() const { return traits.mousefactor; }
254      private:      private:
255          virtual void on_actorhit(Actor *a) {}          virtual void on_actorhit(Actor *a) {}
256    
257          double _friction;          FloorTraits traits;
         double _mousefactor;  
258      };      };
259  }  }
260    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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