#ifndef HOLESOME_COLLECTABLE_SIM_GROUND_HPP #define HOLESOME_COLLECTABLE_SIM_GROUND_HPP #include #include #include "collectable_sim_ground_segment.hpp" #include "../layouts/depth_hole_layout.hpp" class CollectableSimGround { public: explicit CollectableSimGround(std::shared_ptr world, float groundWidth = 1000); void setGroundWidth(float width); void createLayout(DepthHoleLayout &layout); private: std::vector> segments; std::shared_ptr world; std::vector currentLayoutHoles; float groundWidth; struct SideSegments { std::shared_ptr left; std::shared_ptr right; }; CollectableSimGround::SideSegments getOuterSegments(); void updateOuterSegmentsToWidth(); std::shared_ptr createSegment(float leftCorner, float rightCorner, std::shared_ptr segment = nullptr); void closeAllHoles(); bool hasLayoutChanged(DepthHoleLayout &layout); }; #endif //HOLESOME_COLLECTABLE_SIM_GROUND_HPP