Files
dusklight/src/dusk/randomizer/generator/randomizer.hpp
T
CraftyBoss 6366ab61d1 add inventory resetting on server connect, properly handle getting new items from locations, integrate some of archi into new rando ui stuff
For the most part, solo archipelago runs seem to work fine now using the original TP apworld, but im sure there are plenty of weird issues still that need to be handled.
2026-06-19 17:07:42 -07:00

61 lines
2.2 KiB
C++

#pragma once
#include "logic/world.hpp"
#include <optional>
namespace randomizer
{
class Randomizer
{
public:
Randomizer() = delete;
Randomizer(const std::filesystem::path& baseOutputPath) : _baseOutputPath(baseOutputPath) {}
/**
* @brief Generates a complete randomizer seed
*
* @return a std::optional<std::string> containing a message if there was an error.
*/
std::optional<std::string> Generate();
void GenerateWorlds();
void GenerateTrackerWorld(bool useAntiSpoilerLog = true);
auto& GetConfig() { return this->_config; }
auto& GetWorlds() { return this->_worlds; }
/**
* @param worldId
* @return The world with the specified Id. If no Id is specified, the first world will
* be returned. If a world with the Id does not exist, a nullptr will be returned.
*/
logic::world::World* GetWorld(int worldId = 1);
int GetNewEventID() { return ++(this->_eventIdCounter); }
int GetNewAreaID() { return ++(this->_areaIdCounter); }
int GetNewLocAccID() { return ++(this->_locAccIdCounter); }
auto& GetPlaythroughSpheres() { return this->_playthroughSpheres; }
auto& GetEntranceSpheres() { return this->_entranceSpheres; }
std::filesystem::path GetSeedOutputPath();
std::filesystem::path GetBaseOutputPath() const { return this->_baseOutputPath; };
void SetBaseOutputPath(const std::filesystem::path& path) { this->_baseOutputPath = path; };
std::filesystem::path GetConfigPath() const { return this->GetBaseOutputPath() / "settings.yaml"; }
std::filesystem::path GetPrefPath() const { return this->GetBaseOutputPath() / "preferences.yaml"; }
private:
seedgen::config::Config _config{};
logic::world::WorldPool _worlds{};
int _eventIdCounter{};
int _areaIdCounter{};
int _locAccIdCounter{};
// Playthrough data
std::list<std::list<logic::location::Location*>> _playthroughSpheres{};
std::list<std::list<logic::entrance::Entrance*>> _entranceSpheres{};
std::filesystem::path _baseOutputPath{RANDO_SAVE_PATH};
};
} // namespace randomizer