Fix for coverity #29401
[supertux.git] / src / object / block.hpp
index fd06c2c..767a414 100644 (file)
 
 #include <memory>
 
+#include "sprite/sprite_ptr.hpp"
 #include "supertux/moving_object.hpp"
 #include "util/reader_fwd.hpp"
 
-class Sprite;
 class Player;
 
 class Block : public MovingObject
 {
 public:
-  Block(std::auto_ptr<Sprite> sprite);
+  Block(SpritePtr sprite);
   ~Block();
 
   virtual HitResponse collision(GameObject& other, const CollisionHit& hit);
@@ -43,7 +43,7 @@ protected:
   void start_break(GameObject* hitter);
   void break_me();
 
-  std::auto_ptr<Sprite> sprite;
+  SpritePtr sprite;
   bool bouncing;
   bool breaking;
   float bounce_dir;
@@ -55,49 +55,6 @@ private:
   Block& operator=(const Block&);
 };
 
-class BonusBlock : public Block
-{
-public:
-  BonusBlock(const Vector& pos, int data);
-  BonusBlock(const Reader& lisp);
-  virtual ~BonusBlock();
-  HitResponse collision(GameObject& other, const CollisionHit& hit);
-
-  void try_open();
-
-  enum Contents {
-    CONTENT_COIN,
-    CONTENT_FIREGROW,
-    CONTENT_ICEGROW,
-    CONTENT_STAR,
-    CONTENT_1UP,
-    CONTENT_CUSTOM
-  };
-
-  Contents contents;
-protected:
-  virtual void hit(Player& player);
-
-private:
-  MovingObject* object;
-};
-
-class Brick : public Block
-{
-public:
-  Brick(const Vector& pos, int data);
-
-  void try_break(Player* player = false);
-  HitResponse collision(GameObject& other, const CollisionHit& hit);
-
-protected:
-  virtual void hit(Player& player);
-
-private:
-  bool breakable;
-  int coin_counter;
-};
-
 #endif
 
 /* EOF */