VEGO-Engine  0.1
Loading...
Searching...
No Matches
TileComponent.h
1#pragma once
2
3#include <SDL3/SDL.h>
4#include <string>
5#include <map>
6
7#include "Component.h"
8#include "Textures.h"
9
10class SpriteComponent;
12
13class TileComponent : public Component
14{
15public:
16 TransformComponent* transform;
17 SpriteComponent* sprite;
18
19 SDL_Rect tileRect;
20 int tileID;
21 Textures texture;
22
23 TileComponent() = default;
24 TileComponent(int x, int y, int w, int h, int id, const std::map<int, std::pair<Textures, bool>>* textureDict);
25 ~TileComponent() = default;
26
27 void init() override;
28
29 bool hasCollision() {
30 return this->collision;
31 }
32
33
34private:
35 bool collision;
36};
SpriteComponent class to handle sprite rendering and animation.
Definition SpriteComponent.h:18
Adds a transform to an entity when added via entity.addComponent()
Definition TransformComponent.h:11