35 lines
599 B
C
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;
|
||
|
};
|
||
|
}
|