Fixed trailing whitespaces in all(?) source files of supertux, also fixed some svn...
[supertux.git] / src / object / bullet.hpp
index 3664f33..c3464d7 100644 (file)
 #include "moving_object.hpp"
 #include "physic.hpp"
 #include "sprite/sprite.hpp"
+#include "player_status.hpp"
 
-class Bullet : public MovingObject
+class Bullet : public MovingObject, private UsesPhysic
 {
 public:
-  Bullet(const Vector& pos, float xm, int dir);
+  Bullet(const Vector& pos, float xm, int dir, BonusType type);
   ~Bullet();
-  
+
   void update(float elapsed_time);
   void draw(DrawingContext& context);
   void collision_solid(const CollisionHit& hit);
   HitResponse collision(GameObject& other, const CollisionHit& hit);
 
+  /**
+   * Makes bullet bounce off an object (that got hit).
+   * To be called by the collision handler of that object.
+   * Note that the @c hit parameter is filled in as perceived by the object, not by the bullet.
+   */
+  void ricochet(GameObject& other, const CollisionHit& hit);
+
+  BonusType get_type()
+  {
+    return type;
+  }
+
 private:
   int life_count;
-  Physic physic;
   std::auto_ptr<Sprite> sprite;
+  BonusType type;
 };
 
 #endif