Acid.
[sdlbotor.git] / Map.h
blob3b6efbdc5261ce0de2363890b06731334168b7ab
1 #ifndef MAP_H
2 #define MAP_H
4 #ifdef __linux__
5 #include <SDL/SDL.h>
6 #else
7 #include <SDL.h>
8 #endif
10 #include <vector>
12 #include "Tile.h"
13 #include "Tileset.h"
14 #include "Map.h"
15 #include "Robot.h"
19 namespace botor
22 class Map
25 Tileset tileset;
27 public:
29 unsigned static const int MAP_WIDTH = 40;
30 unsigned static const int MAP_HEIGHT = 28;
32 unsigned static const int MAP_SHIFT = 2 * Tileset::TILE_HEIGHT;
34 private:
36 std::vector<std::vector<Tile> > tiles; // ( MAP_WIDTH, std::vector<Tile>( MAP_HEIGHT ) );
37 std::vector<Robot*> robots;
40 public:
42 Map();
44 bool load( const char *fmap );
45 void unload();
47 void Initialize();
49 void Update();
50 void Draw( );
52 Tile *tileAt( Uint8 mapX, Uint8 mapY );
54 bool PushPushable( Uint8 fromX, Uint8 fromY, Uint8 dirX, Uint8 dirY );
56 void RemoveTile( Uint8 mapX, Uint8 mapY );
58 bool isRobotOn( Uint8 mapX, Uint8 mapY );
60 void Acid( Uint8 cX, Uint8 cY );
62 static void transformM2S( Uint8 mapX, Uint8 mapY, Sint16 &x, Sint16 &y ); //MapCoordinates to ScreenC.
68 #endif