X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FArea.h;fp=src%2Fmap%2FArea.h;h=9bca341c11fdbd6d977f7a042e8da98e63e10a12;hb=59c4aea0762cbc5f1bf74c5b1b35629408fb92af;hp=0000000000000000000000000000000000000000;hpb=2a1d9169e1f6c2dfe0f93ed40d5fb68d3da342af;p=l2e.git diff --git a/src/map/Area.h b/src/map/Area.h new file mode 100644 index 0000000..9bca341 --- /dev/null +++ b/src/map/Area.h @@ -0,0 +1,49 @@ +/* + * Area.h + * + * Created on: Sep 26, 2012 + * Author: holy + */ + +#ifndef MAP_AREA_H_ +#define MAP_AREA_H_ + +#include "../geometry/Vector.h" + +#include + +namespace graphics { + class Sprite; +} + +namespace map { + +class Tile; + +class Area { + +public: + Area(); + ~Area() { } + +public: + int Width() const { return width; } + int Height() const { return numTiles / width + (numTiles % width ? 1 : 0); } + + void Render(SDL_Surface *dest, const graphics::Sprite *tileset, const geometry::Vector &offset) const; + +// temporary setters +public: + void SetTiles(const Tile *t, int num) { tiles = t; numTiles = num; } + void SetWidth(int w) { width = w; } + +private: + const Tile *tiles; + int numTiles; + int width; + +}; + +} + +#endif /* MAP_AREA_H_ */