Files
prog2/Game/Levels/World/Building.h
2024-05-29 00:00:29 +02:00

35 lines
874 B
C++

#pragma once
#include <functional>
#include "Texture.h"
#include "TextureManager.h"
class Building
{
public:
Building(const std::string& filePath, const Vector2f& position, const Rectf& boundingBox, TextureManager* pTextureManager);
// Building(const Building& other) = default;
// Building(Building&& other) = default;
// Building& operator=(const Building& other) = default;
// Building& operator=(Building&& other) = default;
~Building();
void Draw() const;
void Update(float dt, const Rectf& objectBoundingBox);
void SetOnEnterHitbox(std::function<void(void)> onEnterHitbox);
private:
bool IsObjectInHitbox(const Rectf& objectBoundingBox) const;
Texture* m_Texture;
Vector2f m_Position;
Vector2f m_Size;
Rectf m_BoundingBox;
std::function<void(void)> m_OnEnterHitbox;
bool m_IsPlayerInHitbox{ false };
bool m_DidPlayerEnterHitbox{ false };
};