35 lines
797 B
C++
35 lines
797 B
C++
|
#ifndef HOLESOME_COLLECTABLE_SIM_GROUND_HPP
|
||
|
#define HOLESOME_COLLECTABLE_SIM_GROUND_HPP
|
||
|
|
||
|
|
||
|
#include <vector>
|
||
|
#include <memory>
|
||
|
#include "collectable_sim_ground_segment.hpp"
|
||
|
|
||
|
class CollectableSimGround
|
||
|
{
|
||
|
public:
|
||
|
CollectableSimGround(std::shared_ptr<b2World> world, float groundWidth = 1000);
|
||
|
|
||
|
void closeAllHoles();
|
||
|
|
||
|
void setGroundWidth(float width);
|
||
|
|
||
|
private:
|
||
|
std::vector<std::shared_ptr<CollectableSimGroundSegment>> segments;
|
||
|
std::shared_ptr<b2World> world;
|
||
|
float groundWidth;
|
||
|
|
||
|
struct SideSegments {
|
||
|
std::shared_ptr<CollectableSimGroundSegment> left;
|
||
|
std::shared_ptr<CollectableSimGroundSegment> right;
|
||
|
};
|
||
|
|
||
|
SideSegments getOuterSegments(int holeId = -1);
|
||
|
|
||
|
void updateOuterSegmentsToWidth();
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //HOLESOME_COLLECTABLE_SIM_GROUND_HPP
|