- added translation table for the old format
[supertux.git] / src / tile.h
1 //
2 // C++ Interface: tile
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef TILE_H
13 #define TILE_H
14
15 #include <vector>
16 #include "texture.h"
17 #include "globals.h"
18 #include "lispreader.h"
19 #include "setup.h"
20
21 /**
22 Tile Class
23 */
24 struct Tile
25 {
26   std::vector<texture_type> images;
27
28   /** solid tile that is indestructable by Tux */
29   bool solid;
30
31   /** a brick that can be destroyed by jumping under it */
32   bool brick;
33
34   /** FIXME: ? */
35   bool ice;
36
37   /** Bonusbox, content is stored in \a data */
38   bool fullbox;
39
40   /** Tile is a distro/coin */
41   bool distro;
42
43   /** General purpose data attached to a tile (content of a box, type of coin) */
44   int data;
45
46   int anim_speed;
47   unsigned char alpha;
48 };
49
50 class TileManager
51 {
52  private:
53   TileManager();
54   std::vector<Tile*> tiles;
55   static TileManager* instance_ ;
56   void load_tileset(std::string filename);
57   
58  public:
59   static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); }
60   Tile* get(unsigned int id) { if( id < tiles.size()) { return tiles[id]; } else { return NULL; } }
61 };
62
63 #endif