src/supertux/player_status.hpp

Go to the documentation of this file.
00001 //  SuperTux
00002 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
00003 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
00004 //
00005 //  This program is free software: you can redistribute it and/or modify
00006 //  it under the terms of the GNU General Public License as published by
00007 //  the Free Software Foundation, either version 3 of the License, or
00008 //  (at your option) any later version.
00009 //
00010 //  This program is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //  GNU General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU General Public License
00016 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 #ifndef HEADER_SUPERTUX_SUPERTUX_PLAYER_STATUS_HPP
00019 #define HEADER_SUPERTUX_SUPERTUX_PLAYER_STATUS_HPP
00020 
00021 #include <memory>
00022 
00023 #include "util/reader_fwd.hpp"
00024 #include "util/writer_fwd.hpp"
00025 #include "video/color.hpp"
00026 #include "video/surface_ptr.hpp"
00027 
00028 static const float BORDER_X = 10;
00029 static const float BORDER_Y = 10;
00030 
00031 enum BonusType {
00032   NO_BONUS, GROWUP_BONUS, FIRE_BONUS, ICE_BONUS
00033 };
00034 class DrawingContext;
00035 
00040 class PlayerStatus
00041 {
00042   static Color text_color;
00043 public:
00044   PlayerStatus();
00045   ~PlayerStatus();
00046   void reset();
00047   void add_coins(int count, bool play_sound = true);
00048 
00049   void write(Writer& writer);
00050   void read(const Reader& lisp);
00051 
00052   void draw(DrawingContext& context);
00053 
00054 public:
00055   int  coins;
00056   BonusType bonus;
00057   int max_fire_bullets; 
00058   int max_ice_bullets; 
00060 private:
00061   int displayed_coins;
00062   int displayed_coins_frame;
00063   SurfacePtr coin_surface;
00064 
00065 private:
00066   PlayerStatus(const PlayerStatus&);
00067   PlayerStatus& operator=(const PlayerStatus&);
00068 };
00069 
00070 #endif
00071 
00072 /* EOF */

Generated on Mon Jun 9 03:38:23 2014 for SuperTux by  doxygen 1.5.1