Arch Game Engine  0.2
tileset.h
1 #ifndef TILESET_H
2 #define TILESET_H
3 
4 #include <vector>
5 #include "tile.h"
6 
8 class Tileset {
9 private:
10  vector<Tile> tiles;
11 public:
12  Tileset();
13  ~Tileset();
14  vector<Tile> getTileset() const { return tiles; }
15  SDL_Rect getFrame(int i) { tiles[i-1].getFrame(); }
17  vector<Tile> create(string name, string img, SDL_Renderer* ren, int width, int height, int r, int count);
19  vector<Tile> create(string name, string img, SDL_Renderer* ren, int width, int height, int r, int rcount, int count);
21  vector<Tile> create(int startid, string name, string img, SDL_Renderer* ren, int width, int height, int r, int count);
23  vector<Tile> create(int startid, string name, string img, SDL_Renderer* ren, int width, int height, int r, int rcount, int count);
25  void addTile(Tile t);
27  Tile addTile(string name, string file, SDL_Renderer* ren, int value, int r, int c, int width, int height);
29  Tile addTile(string name, string file, SDL_Renderer* ren, int value, int width, int height);
31  Tile addTile(string name, string file, SDL_Renderer* ren, int value, int size);
33  void setAngle(int ang);
34  void setSolid();
35  void setSolid(int t);
36  void setSolid(int s, int e);
37  void setPassable();
38  void setPassable(int t);
39  void setPassable(int s, int e);
40  void setName(string n, int id);
41 };
42 
43 #endif //TILESET_H
Class for loading in multiple Tiles.
Definition: tileset.h:8
vector< Tile > create(string name, string img, SDL_Renderer *ren, int width, int height, int r, int count)
Load in a map file with the name for all the tiles, the path to the map file, path to the tileset ima...
Definition: tileset.cpp:7
void addTile(Tile t)
Push Tile in tile with given Tile.
Definition: tileset.cpp:32
An Object class that stores the a tile value and name.
Definition: tile.h:7
void setAngle(int ang)
Set the angle of all the tiles. Calls pushAng().
Definition: tileset.cpp:55