Massive copyright update. I'm sorry if I'm crediting Matze for something he didn...
[supertux.git] / src / object / player.hpp
index 43cddf9..cc250cb 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
 //
-//  SuperTux -  A Jump'n Run
-//  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
+//  SuperTux
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -16,6 +16,7 @@
 //  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 SUPERTUX_PLAYER_H
 #define SUPERTUX_PLAYER_H
 
@@ -32,7 +33,9 @@
 #include "scripting/player.hpp"
 #include "player_status.hpp"
 #include "display_effect.hpp"
+#include "script_interface.hpp"
 #include "console.hpp"
+#include "coin.hpp"
 
 class BadGuy;
 class Portable;
@@ -78,7 +81,21 @@ extern TuxBodyParts* big_tux;
 extern TuxBodyParts* fire_tux;
 extern TuxBodyParts* ice_tux;
 
-class Player : public MovingObject, public Scripting::Player, public ConsoleCommandReceiver
+class FallingCoin : public GameObject
+{
+public:
+  FallingCoin(const Vector& start_position, const int x_vel);
+  ~FallingCoin();
+
+  void draw(DrawingContext& context);
+  void update(float elapsed_time);
+private:
+  Vector  pos;
+  Sprite* sprite;
+  Physic  physic;
+};
+
+class Player : public MovingObject, public Scripting::Player, public ScriptInterface
 {
 public:
   enum HurtMode { KILL, SHRINK };
@@ -121,6 +138,9 @@ public:
   Player(PlayerStatus* player_status);
   virtual ~Player();
 
+  virtual void expose(HSQUIRRELVM vm, int table_idx);
+  virtual void unexpose(HSQUIRRELVM vm, int table_idx);
+
   void set_controller(Controller* controller);  
 
   virtual void update(float elapsed_time);
@@ -141,6 +161,9 @@ public:
   void kill(HurtMode mode);
   void check_bounds(Camera* camera);
   void move(const Vector& vector);
+
+  virtual void set_bonus(const std::string& bonus);
+  virtual void add_coins(int count);
   void set_bonus(BonusType type, bool animate = false);
   PlayerStatus* get_status()
   {
@@ -165,8 +188,6 @@ public:
 
   bool on_ground();
 
-  bool consoleCommand(std::string command, std::vector<std::string> arguments); /**< callback from Console; return false if command was unknown, true otherwise */
-  
 private:
   void handle_input();
   bool deactivated;