X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fblock.h;h=43321f14c6255b3072b6369d634f4fb1207f6c65;hb=eb7c6ccdd326f6bceb67cd5259015dd994b04928;hp=d70bc6d3cb9b1dc9154bba2dda0afac342b809df;hpb=626ab69641b179048b9d0fc528cd1626886fe9db;p=supertux.git diff --git a/src/object/block.h b/src/object/block.h index d70bc6d3c..43321f14c 100644 --- a/src/object/block.h +++ b/src/object/block.h @@ -1,19 +1,35 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2005 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. #ifndef __BLOCK_H__ #define __BLOCK_H__ -#include "special/moving_object.h" +#include "moving_object.h" +#include "lisp/lisp.h" -namespace SuperTux { - class Sprite; -} +class Sprite; class Player; -using namespace SuperTux; - class Block : public MovingObject { public: - Block(const Vector& pos, Sprite* sprite); + Block(Sprite* sprite = 0); ~Block(); virtual HitResponse collision(GameObject& other, const CollisionHit& hit); @@ -35,6 +51,7 @@ class BonusBlock : public Block { public: BonusBlock(const Vector& pos, int data); + BonusBlock(const lisp::Lisp& lisp); void try_open(); @@ -42,7 +59,15 @@ protected: virtual void hit(Player& player); private: - int data; + enum Contents { + CONTENT_COIN, + CONTENT_FIREGROW, + CONTENT_ICEGROW, + CONTENT_STAR, + CONTENT_1UP + }; + + Contents contents; }; class Brick : public Block