X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fplayer_status.hpp;h=3df230be339378460761adb6a5f05c06e2e991ee;hb=f53572ad2b744ddddd7cc4b6479489543d44f98d;hp=06db4f1ceaed371f40c31d3627a432c151c6952c;hpb=b72c5d178e4cc95130735d8bf8716513c7cc28e1;p=supertux.git diff --git a/src/player_status.hpp b/src/player_status.hpp index 06db4f1ce..3df230be3 100644 --- a/src/player_status.hpp +++ b/src/player_status.hpp @@ -1,7 +1,8 @@ // $Id$ // -// SuperTux - A Jump'n Run +// SuperTux // Copyright (C) 2003 Tobias Glaesser +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -19,10 +20,13 @@ #ifndef SUPERTUX_PLAYERSTATUS_H #define SUPERTUX_PLAYERSTATUS_H +#include +#include #include "lisp/lisp.hpp" #include "timer.hpp" #include "serializable.hpp" #include "sprite/sprite.hpp" +#include "console.hpp" static const float BORDER_X = 10; static const float BORDER_Y = 10; @@ -36,44 +40,36 @@ class DrawingContext; * This class memorizes player status between different game sessions (for * example when switching maps in the worldmap) */ -class PlayerStatus : public Serializable +class PlayerStatus : public Serializable, public ConsoleCommandReceiver { public: PlayerStatus(); ~PlayerStatus(); void reset(); - void incLives(); - void incCoins(); - void set_keys(int new_key); + void add_coins(int count); void write(lisp::Writer& writer); void read(const lisp::Lisp& lisp); void draw(DrawingContext& context); - void draw_keys(DrawingContext& context); + bool consoleCommand(std::string command, std::vector arguments); /**< callback from Console; return false if command was unknown, true otherwise */ + int coins; - int lives; BonusType bonus; + int max_fire_bullets; /**< maximum number of fire bullets in play */ + int max_ice_bullets; /**< maximum number of ice bullets in play */ int score_multiplier; int max_score_multiplier; - - enum { - KEY_BRASS = 0x001, - KEY_IRON = 0x002, - KEY_BRONZE = 0x004, - KEY_SILVER = 0x008, - KEY_GOLD = 0x010, - }; + void operator= (const PlayerStatus& other); + private: - int keys; - Sprite* key_iron; - Sprite* key_brass; - Sprite* key_bronze; - Sprite* key_silver; - Sprite* key_gold; + // don't use this + PlayerStatus(const PlayerStatus& other); + + std::auto_ptr tux_life; }; // global player state