#include "KTile.h" #include #include "Constants.h" #include "KTexture.h" namespace KapitanGame { int KTile::GetType() const { return static_cast(Type); } SDL_Rect KTile::GetBox() const { return Box; } KTile::KTile(const int x, const int y, const TileType tileType) { //Get the offsets Box.x = x; Box.y = y; Box.w = Constants::TILE_WIDTH; Box.h = Constants::TILE_HEIGHT; //Get the tile type Type = tileType; } void KTile::Render(SDL_Renderer* renderer, KTexture tileTextures[], const SDL_Rect& camera, const float scale) const { tileTextures[GetType()].Render(renderer, Box.x - camera.x, Box.y - camera.y, nullptr, scale); } }