libBeatsaber/include/beatsaber-impl/beatlevelimpl.h

54 lines
1.3 KiB
C
Raw Normal View History

2021-06-01 11:47:41 +02:00
#pragma once
#include "beatlevel.h"
#include <nlohmann/json_fwd.hpp>
using json = nlohmann::json;
2021-06-04 10:41:24 +02:00
#include "filereader.h"
2021-06-01 11:47:41 +02:00
namespace Beatsaber {
2021-06-01 21:05:33 +02:00
class BeatLevelImpl : public BeatLevel, public std::enable_shared_from_this<BeatLevelImpl> {
2021-06-01 11:47:41 +02:00
protected:
std::weak_ptr<BeatSet> parent;
Difficulty::Difficulty dif;
int32_t diffRank;
std::string filename;
double njs;
double nso;
2021-06-12 20:17:24 +02:00
std::shared_ptr<FileReader> reader;
2021-06-01 11:47:41 +02:00
const json& base;
2021-06-04 13:15:13 +02:00
std::vector<Note> notes;
2021-06-04 14:53:31 +02:00
std::vector<Wall> walls;
2021-06-04 13:15:13 +02:00
2021-06-01 11:47:41 +02:00
public:
2021-06-04 10:41:24 +02:00
BeatLevelImpl(std::weak_ptr<BeatSet> p, std::shared_ptr<FileReader> r, const json& j);
2021-06-01 11:47:41 +02:00
virtual ~BeatLevelImpl();
2021-06-12 20:17:24 +02:00
bool load();
2021-06-01 11:47:41 +02:00
virtual Difficulty::Difficulty getDifficulty() const override;
virtual int32_t getDifficultyRank() const override;
virtual std::string getFilename() const override;
virtual double getNoteJumpSpeed() const override; // in m
virtual double getNoteStartOffset() const override;
virtual std::string getCustomData() const override;
//TODO: get level content
2021-06-04 13:15:13 +02:00
virtual const std::vector<Note>& getNotes() const override;
2021-06-04 14:53:31 +02:00
virtual const std::vector<Wall>& getWalls() const override;
2021-06-01 11:47:41 +02:00
2021-06-01 21:05:33 +02:00
virtual void printDebug() const override;
2021-06-01 11:47:41 +02:00
virtual std::shared_ptr<BeatSet> getBeatSet() const override;
virtual std::shared_ptr<BeatMap> getBeatMap() const override;
2021-06-14 14:02:42 +02:00
virtual std::shared_ptr<BeatLevelRenderHelper> getRenderHelper() const override;
2021-06-01 11:47:41 +02:00
};
}