/[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.21 by reallysoft, Sun May 11 17:54:04 2003 UTC revision 1.22 by reallysoft, Wed May 14 08:09:57 2003 UTC
# Line 114  namespace world Line 114  namespace world
114    
115          const char *get_kind() const;          const char *get_kind() const;
116    
117            void send_impulse(const GridPos& dest, Direction dir);
118    
119          // Object interface          // Object interface
120          virtual void message(const string& msg, const Value &val);          virtual void message(const string& msg, const Value &val);
121          virtual void set_attrib(const string& key, const Value &val);          virtual void set_attrib(const string& key, const Value &val);
# Line 130  namespace world Line 132  namespace world
132      };      };
133  }  }
134    
135    /*
136     * Impulse is used to transfer force from one Object to another Object
137     * (currently only Stones can be the destination of Impulse's)
138     */
139    namespace world {
140        struct Impulse {
141            Object    *sender;
142            GridPos    dest;
143            Direction  dir;
144    
145            Impulse(Object *sender_, const GridPos& dest_, Direction dir_)
146                :  sender(sender_), dest(dest_), dir(dir_) {}
147        };
148    };
149    
150    
151    
152  /*  /*
153   * GridObject is the base class for everything that can only be placed   * GridObject is the base class for everything that can only be placed
# Line 334  namespace world Line 352  namespace world
352          virtual bool   is_movable() { return false;}          virtual bool   is_movable() { return false;}
353    
354          virtual void   on_move() {}          virtual void   on_move() {}
355          virtual void   on_impulse(Direction dir) { if (is_movable()) move_stone(dir); }          virtual void   on_impulse(const Impulse& impulse) { if (is_movable()) move_stone(impulse.dir); }
356    
357          virtual const char *collision_sound();          virtual const char *collision_sound();
358    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

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