ajtgarber

Map (map.h)

May 5th, 2011
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #include <SDL/SDL.h>
  2. #include <fstream>
  3. #include <vector>
  4. #include <iostream>
  5.  
  6. #include "Tile.h"
  7.  
  8. using namespace std;
  9.  
  10. #ifndef MAP_H
  11. #define MAP_H
  12.  
  13. class Map {
  14.     private:
  15.         vector<SDL_Surface*> surfaces;
  16.         vector<char*> surfacePaths;
  17.         Tile tiles[32][32];
  18.         int width;
  19.         int height;
  20.         int tileSize;
  21.         int xtrans;
  22.         int ytrans;
  23.  
  24.     public:
  25.         Map(int width, int height, int tileSize);
  26.         virtual ~Map();
  27.  
  28.         int getWidth();
  29.         int getHeight();
  30.         Tile getTile(int x, int y);
  31.         void setTile(Tile tile, int x, int y);
  32.        
  33.         void shiftX(int x);
  34.         void shiftY(int y);
  35.         int currShiftX();
  36.         int currShiftY();
  37.         int getTileSize();
  38.         void setTileSize(int tileSize);
  39.  
  40.         void addSheet(SDL_Surface* sheet, char* filename);
  41.         SDL_Surface* getSheet(int n);
  42.         int getSheetNum(int x, int y);
  43.         char* getSheetPath(int n);
  44.         int numSheets();
  45.  
  46.         void render(SDL_Surface* screen);
  47. };
  48.  
  49. #endif
Advertisement
Add Comment
Please, Sign In to add comment