/* game.h - evil global variables Copyright (C) 2006 Mark boyd This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be fun to play, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include "explosion.h" #include "weapons.h" class arena; struct SDL_Surface; //Useful class which means we can get bitmaps from filenames //but we only hit the disk once per filename class bitmap_pool { public: SDL_Surface *get_bitmap(const std::string &name); ~bitmap_pool(); private: typedef std::map m_map_t; m_map_t m_map; }; struct player_status { int score; int money; int shield; int lives; bool in_shop; float energy; float max_energy; float invulnerability; bool operator==(const player_status &o) { return score == o.score && money == o.money && shield == o.shield && lives == o.lives && energy == o.energy && max_energy == o.max_energy && invulnerability == o.invulnerability; ; } }; struct game { struct { bool up,left,right,tractor,fire; } m_key_flags; arena *m_arena; bitmap_pool m_bmp_pool; explosion_pool m_exp_pool; player_status m_player_status; std::vector m_weapon_mounts; engine_id m_engine; std::vector m_systems; static game* the_game; game(); };