mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 05:43:43 +00:00
33 lines
647 B
C++
33 lines
647 B
C++
#pragma once
|
|
|
|
#include <SDL3/SDL.h>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
#include "Component.h"
|
|
|
|
class SpriteComponent;
|
|
class TransformComponent;
|
|
|
|
class TileComponent : public Component
|
|
{
|
|
public:
|
|
TransformComponent* transform;
|
|
SpriteComponent* sprite;
|
|
|
|
SDL_Rect tileRect;
|
|
int tileID;
|
|
const char* path;
|
|
|
|
TileComponent() = default;
|
|
TileComponent(int x, int y, int w, int h, int id, const std::map<int, std::pair<std::string, bool>>* textureDict);
|
|
~TileComponent() = default;
|
|
|
|
void init() override;
|
|
|
|
bool hasCollision(){return this->collision;}
|
|
std::string getName(){return this->tileName;}
|
|
private:
|
|
bool collision;
|
|
std::string tileName;
|
|
}; |