X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Fcandle.hpp;h=5c5342e05db7a1eced00688aa5f98fd909bf6326;hb=02006fdd9da5000586077bf331620b92854c8125;hp=38ea325892ab730792cfb6597f628294155c4e78;hpb=24e5b19904a9b115a92e933bd62748ff5c198613;p=supertux.git diff --git a/src/object/candle.hpp b/src/object/candle.hpp index 38ea32589..5c5342e05 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,42 +12,49 @@ // 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 */ + bool flicker; /**< true if candle light is to flicker */ + Color lightcolor; /**< determines color or light given off */ + SpritePtr candle_light_1; /**< drawn to lightmap */ + SpritePtr candle_light_2; /**< drawn to lightmap (alternative image) */ }; #endif +/* EOF */