2021-03-02 04:08:10 +00:00
|
|
|
//
|
2021-03-12 23:13:33 +00:00
|
|
|
// Created by SeanOMik on 3/1/2021.
|
2021-03-02 04:08:10 +00:00
|
|
|
// Github: https://github.com/SeanOMik
|
|
|
|
// Email: seanomik@gmail.com
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SIMPLEENGINE_COLLISION_HANDLER_H
|
|
|
|
#define SIMPLEENGINE_COLLISION_HANDLER_H
|
|
|
|
|
|
|
|
#include "../event.h"
|
|
|
|
#include "../entity.h"
|
|
|
|
|
|
|
|
namespace simpleengine {
|
2021-04-04 03:27:44 +00:00
|
|
|
class Game;
|
2021-03-02 04:08:10 +00:00
|
|
|
class CollisionHandler : public Event {
|
|
|
|
public:
|
2021-04-04 03:27:44 +00:00
|
|
|
explicit CollisionHandler(simpleengine::Game& game) : simpleengine::Event(nullptr), game(game) {
|
2021-03-02 04:08:10 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void Update(const float& delta_time) override;
|
|
|
|
void Render(sf::RenderTarget* target) override { }
|
2021-04-04 03:27:44 +00:00
|
|
|
|
|
|
|
void UpdateHandledEntities();
|
2021-03-02 04:08:10 +00:00
|
|
|
private:
|
2021-04-04 03:27:44 +00:00
|
|
|
std::vector<std::shared_ptr<Entity>> handled_entities;
|
|
|
|
simpleengine::Game& game;
|
2021-03-02 04:08:10 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SIMPLEENGINE_COLLISION_HANDLER_H
|