#pragma once
#include "Obstacle.h"

class ObstacleManager {
    float& sceneSpeed;
    std::vector<std::unique_ptr<Obstacle>> obstacles;

    float spawnTimer = 0.f;
public:
    bool allowRandomSpawn = true;

    ObstacleManager(float& sceneSpeed);

    void render(sf::RenderWindow& window);
    void update(const float deltaTime);

    void reset();

    void spawnObstacle(const float x = 0, const float y = 0, const Obstacle::ObstacleType type = Obstacle::CONE);

    enum CollisionType {
        NONE,
        DAMAGE,
        PICKUP_HEALTH,
        PICKUP_FUEL
    };

    CollisionType obstacleCollides(const sf::FloatRect& collisionObject);
};
