X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Flantern.hpp;h=b8498a3db73619ec621f9bb8212e7614a1c2d6d3;hb=555d1b7bebb45326d82d934e07463209837309b0;hp=c5352dfc502b8e0de938c191e5e483a52058f9bb;hpb=69be5aee32ec5b3eb1c65f4569f92746cc8d294c;p=supertux.git diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index c5352dfc5..b8498a3db 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -26,13 +26,31 @@ /** * 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;