#pragma once
#include "DangerousRacers/DrawableEntity.h"


class Obstacle : public DrawableEntity {
public:
    enum ObstacleType {
        CONE,
        WALL,
        FUEL,
        REPAIR
    };

    ObstacleType type;
    float& speed;

    Obstacle(float x, float y, float& speed, const std::string &texturePath, ObstacleType type);

    float getYBottom() {
        return this->getPosition().y + this->getSprite().getGlobalBounds().height;
    }

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

    bool outOfBounds() {
        const auto height = this->getSprite().getGlobalBounds().height;
        return this->getPosition().y > 720.f + height / 2;
    }
};