#include <iostream>
#include <string>
#include <filesystem>
namespace fs = std::filesystem;

class Shot {

public:

    void setShot(float height1, float length1, float width1, float speedX1, float speedY1, float speedZ1, float carX1, float carY1, float carZ1, int carYaw1, std::string nameShot1, int ball1Speed1, int carPitch1, int carRoll1);
    bool createShotFile(std::string filePath1, float height1, float length1, float width1, float speedX1, float speedY1, float speedZ1, float carX1, float carY1, float carZ1, int carYaw1, std::string nameShot1, int ball1Speed1, int carPitch1, int carRoll1);
    bool createDefaultShotFile(std::string filePath1);
    bool readShotFile(std::string filePath1, std::string shotName2);
    bool deleteShotFile();
    bool renameShot(std::string newName);
    float getHeight() const;
    float getLength() const;
    float getWidth() const;
    float getSpeedX() const;
    float getSpeedY() const;
    float getSpeedZ() const;
    float getCarX() const;
    float getCarY() const;
    float getCarZ() const;
    int getCarYaw() const;
    int getCarPitch() const;
    int getCarRoll() const;
    std::string getShotName() const;
    int getBallSpeed() const;
    bool isEmpty();

    Shot();

private:
    void write();
    bool read();
    bool updateShots();
    std::string trimUnderscores(const std::string& input);
    std::string underscoreToSpace(std::string shotName1) const;
    std::string spaceToUnderscore(std::string shotName1);
    inline bool fileExists(const std::string& name);
    float shotheight = 0;
    float shotlength = 0;
    float shotwidth = 0;
    float shotspeedX = 0;
    float shotspeedY = 0;
    float shotspeedZ = 0 ;
    float shotcarX = 0;
    float shotcarY = 0 ;
    float shotcarZ = 0;
    int shotcarYaw = 0;
    int shotcarPitch = 137463;
    int shotcarRoll = 137463;
    std::string filePath;
    std::string folderPath;
    std::string shotName = "";
    int ball1Speed = 0;

};


