31 lines
684 B
C++
31 lines
684 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() = default;
|
|
|
|
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 };
|
|
};
|