2dkg/2dkg_zad5/2dgk_zad5/KTile.h
2022-01-20 08:52:14 +01:00

35 lines
599 B
C++

#pragma once
#include <SDL_rect.h>
#include <cstdint>
#include <SDL_render.h>
namespace KapitanGame
{
class KTexture;
enum class TileType : std::uint32_t {
Default = 0,
Wall = 1
};
class KTile {
public:
//Initializes position and type
KTile(int x, int y, TileType tileType);
//Shows the tile
void Render(SDL_Renderer* renderer, KTexture tileTextures[], const SDL_Rect& camera, float scale = 1.f) const;
//Get the tile type
int GetType() const;
SDL_Rect GetBox() const;
private:
//The attributes of the tile
SDL_Rect Box{};
//The tile type
TileType Type;
};
}