zad5
This commit is contained in:
34
2dkg_zad5/2dgk_zad5/KTile.h
Normal file
34
2dkg_zad5/2dgk_zad5/KTile.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#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;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user