X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Flantern.hpp;h=b8498a3db73619ec621f9bb8212e7614a1c2d6d3;hb=08ccb17345a52f5ffd8a5dd6ecf675cad55f16a7;hp=13356cd85bcbe5e8e9ef17ca0cc2feb9457b2d0e;hpb=85016783ff1628b7de20e0c106cf55563aa77bed;p=supertux.git diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index 13356cd85..b8498a3db 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -26,16 +26,35 @@ /** * Lantern. A portable Light Source. */ -class Lantern : public Rock +class Lantern : public Rock { public: + Lantern(const Vector& pos); Lantern(const lisp::Lisp& reader); void draw(DrawingContext& context); ~Lantern(); + HitResponse collision(GameObject& other, const CollisionHit& hit); + + void grab(MovingObject& object, const Vector& pos, Direction dir); + void ungrab(MovingObject& object, Direction dir); + + /** + * returns true if lamp is currently open + */ + bool is_open(); + + /** + * returns the lamp's color + */ + Color get_color() const { + return lightcolor; + } + private: Color lightcolor; Sprite* lightsprite; + void updateColor(); }; #endif