1 /************************************************************************ 2 * * 3 * FreeSynd - a remake of the classic Bullfrog game "Syndicate". * 4 * * 5 * Copyright (C) 2005 Stuart Binge <skbinge@gmail.com> * 6 * Copyright (C) 2005 Joost Peters <joostp@users.sourceforge.net> * 7 * Copyright (C) 2006 Trent Waddington <qg@biodome.org> * 8 * * 9 * This program is free software; you can redistribute it and / or * 10 * modify it under the terms of the GNU General Public License as * 11 * published by the Free Software Foundation; either version 2 of the * 12 * License, or (at your option) any later version. * 13 * * 14 * This program is distributed in the hope that it will be useful, * 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 17 * General Public License for more details. * 18 * * 19 * You can view the GNU General Public License, online, at the GNU * 20 * project's web site; see <http://www.gnu.org/licenses/gpl.html>. * 21 * The full text of the license is also included in the file COPYING. * 22 * * 23 ************************************************************************/ 24 25 #ifndef TILEMANAGER_H 26 #define TILEMANAGER_H 27 28 #include "common.h" 29 #include "tile.h" 30 31 /*! 32 * Tile manager loads and holds all the game tiles. 33 */ 34 class TileManager { 35 public: 36 /*! The total number of tiles.*/ 37 static const int kNumOfTiles; 38 39 TileManager(); 40 ~TileManager(); 41 //! Loads tiles from the file 42 bool loadTiles(); 43 44 //! Returns tile with the given index 45 Tile * getTile(uint8 index); 46 47 protected: 48 //! Load a given tile 49 Tile * loadTile(uint8 *tileData, uint8 id, Tile::EType type); 50 //! Returns the good enum for the given data 51 Tile::EType toTileType(uint8 data); 52 53 protected: 54 //! All the tiles in the game 55 Tile **a_tiles_; 56 }; 57 58 #endif 59