fix cr/lfs and remove trailing whitespaces...
[supertux.git] / src / object / candle.hpp
index dd58647..9c3547a 100644 (file)
 #ifndef __CANDLE_H__
 #define __CANDLE_H__
 
+#include <string>
+
 #include "lisp/lisp.hpp"
 #include "object/moving_sprite.hpp"
-#include "serializable.hpp"
+#include "script_interface.hpp"
 
 /**
- * A burning candle: Simple level decoration.
+ * A burning candle: Simple, scriptable level decoration.
  */
-class Candle : public MovingSprite, public Serializable
+class Candle : public MovingSprite, public ScriptInterface
 {
 public:
   Candle(const lisp::Lisp& lisp);
   virtual Candle* clone() const { return new Candle(*this); }
-  
-  void write(lisp::Writer& writer);
+
   HitResponse collision(GameObject& other, const CollisionHit& hit);
 
+  virtual void expose(HSQUIRRELVM vm, SQInteger table_idx);
+  virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
+
+  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 */
+
 };
 
 #endif
-