new levelformat with multiple layers and and new tileset code. Along with a new parti...
[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 bool solid;
28 bool brick;
29 bool ice;
30 bool fullbox;
31 int anim_speed;
32 unsigned char alpha;
33 };
34
35 class TileManager
36 {
37 private:
38  TileManager();
39  std::vector<Tile*> tiles;
40  static TileManager* instance_ ;
41  void load_tileset(std::string filename);
42   
43 public:
44  static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); }
45  Tile* get(unsigned int id) { if( id < tiles.size()) { return tiles[id]; } else { return NULL; } } ;
46
47 };
48
49 #endif