X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fobject%2Fblock.hpp;h=767a414f2421a90588ead8b00a6be040ab7d90df;hb=64842a0700a2ee8a3d2d61ad2685217f5060985a;hp=fd06c2ca7f8292f6b12ab28b29a11cf89fcb14a0;hpb=08813a74da6ac1fd045a105e4e8105f1d7f716f0;p=supertux.git diff --git a/src/object/block.hpp b/src/object/block.hpp index fd06c2ca7..767a414f2 100644 --- a/src/object/block.hpp +++ b/src/object/block.hpp @@ -19,16 +19,16 @@ #include +#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); + 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; + 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 */