X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fplayer_status.hpp;h=1840ab8ead55d4c58db0f6f3d516bcbc9a0691f0;hb=657fc40723665c04b3150946f5bd66b6b0af9230;hp=5595d970176f1540f63993519756e4c57f1be381;hpb=07ddaed2a657e4d2a3d038fed223fc5827159caf;p=supertux.git diff --git a/src/player_status.hpp b/src/player_status.hpp index 5595d9701..1840ab8ea 100644 --- a/src/player_status.hpp +++ b/src/player_status.hpp @@ -20,13 +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" +#include "video/color.hpp" + +namespace lisp{ class Writer; } +namespace lisp{ class Lisp; } +class Surface; static const float BORDER_X = 10; static const float BORDER_Y = 10; @@ -36,54 +36,36 @@ enum BonusType { }; class DrawingContext; -/** +/** * This class memorizes player status between different game sessions (for * example when switching maps in the worldmap) */ -class PlayerStatus : public Serializable, public ConsoleCommandReceiver +class PlayerStatus : public Serializable { + static Color text_color; public: PlayerStatus(); ~PlayerStatus(); - void reset(); - void add_coins(int count); - void set_keys(int new_key); + void reset(); + void add_coins(int count, bool play_sound = true); 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; BonusType bonus; - - int score_multiplier; - int max_score_multiplier; + int max_fire_bullets; /**< maximum number of fire bullets in play */ + int max_ice_bullets; /**< maximum number of ice bullets in play */ void operator= (const PlayerStatus& other); - - enum { - KEY_BRASS = 0x001, - KEY_IRON = 0x002, - KEY_BRONZE = 0x004, - KEY_SILVER = 0x008, - KEY_GOLD = 0x010, - }; private: // don't use this PlayerStatus(const PlayerStatus& other); - - int keys; - std::auto_ptr tux_life; - std::auto_ptr key_iron; - std::auto_ptr key_brass; - std::auto_ptr key_bronze; - std::auto_ptr key_silver; - std::auto_ptr key_gold; + + std::auto_ptr coin_surface; }; // global player state