X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fcandle.hpp;h=ea82414a4e3391dc20b1a4b5278bb15b27086aa1;hb=78ac7aef674f518549f96160c6354b589553f952;hp=9c3547a6ff7c3cbdfcc9bf5c856611615f228425;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/object/candle.hpp b/src/object/candle.hpp index 9c3547a6f..ea82414a4 100644 --- a/src/object/candle.hpp +++ b/src/object/candle.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux // Copyright (C) 2006 Christoph Sommer // -// 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 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 3 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 @@ -14,41 +12,47 @@ // 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 __CANDLE_H__ -#define __CANDLE_H__ +// along with this program. If not, see . -#include +#ifndef HEADER_SUPERTUX_OBJECT_CANDLE_HPP +#define HEADER_SUPERTUX_OBJECT_CANDLE_HPP -#include "lisp/lisp.hpp" #include "object/moving_sprite.hpp" -#include "script_interface.hpp" +#include "supertux/script_interface.hpp" /** * A burning candle: Simple, scriptable level decoration. */ -class Candle : public MovingSprite, public ScriptInterface +class Candle : public MovingSprite, + public ScriptInterface { public: - Candle(const lisp::Lisp& lisp); - virtual Candle* clone() const { return new Candle(*this); } + Candle(const Reader& lisp); + virtual void draw(DrawingContext& context); HitResponse collision(GameObject& other, const CollisionHit& hit); virtual void expose(HSQUIRRELVM vm, SQInteger table_idx); virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx); + /** + * @name Scriptable Methods + * @{ + */ void puff_smoke(); /**< spawn a puff of smoke */ - bool get_burning(); /**< returns true if candle is lighted */ void set_burning(bool burning); /**< true: light candle, false: extinguish candle */ + /** + * @} + */ private: bool burning; /**< true if candle is currently lighted */ - std::string name; /**< user-defined name for use in scripts or empty string if not scriptable */ + Surface candle_light_1; /**< drawn to lightmap */ + Surface candle_light_2; /**< drawn to lightmap (alternative image) */ }; #endif + +/* EOF */