2023-06-28 16:57:13 +02:00
|
|
|
#ifndef HOLESOME_COLLECTABLE_SIMULATION_HPP
|
|
|
|
#define HOLESOME_COLLECTABLE_SIMULATION_HPP
|
|
|
|
|
|
|
|
|
|
|
|
#include <box2d/box2d.h>
|
2023-07-03 01:16:44 +02:00
|
|
|
#include <map>
|
2023-06-28 16:57:13 +02:00
|
|
|
#include "../../game_object.h"
|
|
|
|
#include "../../collectables/collectable.hpp"
|
2023-07-03 01:16:44 +02:00
|
|
|
#include "ground/collectable_sim_ground_segment.hpp"
|
|
|
|
#include "ground/collectable_sim_ground.hpp"
|
|
|
|
#include "../body_adapter.hpp"
|
2023-06-28 16:57:13 +02:00
|
|
|
|
|
|
|
class CollectableSimulation : public GameObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit CollectableSimulation(const std::shared_ptr<Collectable> &collectable);
|
|
|
|
|
|
|
|
void physicsUpdate() override;
|
|
|
|
|
2023-06-30 20:57:28 +02:00
|
|
|
[[nodiscard]] std::shared_ptr<Collectable> getCollectable() const;
|
2023-06-28 16:57:13 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<b2World> world;
|
2023-07-03 01:16:44 +02:00
|
|
|
std::shared_ptr<BodyAdapter> collectableBody;
|
2023-06-28 16:57:13 +02:00
|
|
|
|
|
|
|
std::shared_ptr<Collectable> collectable;
|
|
|
|
|
2023-07-03 01:16:44 +02:00
|
|
|
std::shared_ptr<CollectableSimGround> simGround;
|
|
|
|
|
2023-06-28 16:57:13 +02:00
|
|
|
void updateGroundHole();
|
2023-06-29 21:26:30 +02:00
|
|
|
|
|
|
|
void updateCollectable();
|
2023-06-28 16:57:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //HOLESOME_COLLECTABLE_SIMULATION_HPP
|