mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 09:03:42 +00:00
since getName is no longer used from the TileComponent.h we no longer need magic_enum for the enum to string conversion also some minor documentation changes
36 lines
599 B
C++
36 lines
599 B
C++
#pragma once
|
|
|
|
#include <SDL.h>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
#include "Component.h"
|
|
#include "Textures.h"
|
|
|
|
class SpriteComponent;
|
|
class TransformComponent;
|
|
|
|
class TileComponent : public Component
|
|
{
|
|
public:
|
|
TransformComponent* transform;
|
|
SpriteComponent* sprite;
|
|
|
|
SDL_Rect tileRect;
|
|
int tileID;
|
|
Textures texture;
|
|
|
|
TileComponent() = default;
|
|
TileComponent(int x, int y, int w, int h, int id, const std::map<int, std::pair<Textures, bool>>* textureDict);
|
|
~TileComponent() = default;
|
|
|
|
void init() override;
|
|
|
|
bool hasCollision() {
|
|
return this->collision;
|
|
}
|
|
|
|
|
|
private:
|
|
bool collision;
|
|
}; |