mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-03 11:00:16 -04:00
more intuitive GetWorld function
This commit is contained in:
@@ -234,7 +234,7 @@ namespace dusk {
|
||||
}
|
||||
|
||||
if (randomizer_IsActive()) {
|
||||
auto currentItems = getSaveItemPool(trackerRando->GetWorlds()[0].get());
|
||||
auto currentItems = getSaveItemPool(trackerRando->GetWorld());
|
||||
m_currentSearch = randomizer::logic::search::Search::AccessibleNoStartingInventory(&trackerRando->GetWorlds(), currentItems);
|
||||
}
|
||||
m_currentSearch.SearchWorlds();
|
||||
@@ -252,7 +252,7 @@ namespace dusk {
|
||||
ImGui::InputText("Location Filter", m_locationFilter, 100);
|
||||
|
||||
// Show total number of available locations
|
||||
auto locations = trackerRando->GetWorlds()[0]->GetAllLocations();
|
||||
auto locations = trackerRando->GetWorld()->GetAllLocations();
|
||||
auto numProgressionLocations = std::ranges::count_if(locations, [](auto* location) {return location->IsProgression();});
|
||||
auto numAvailableLocations = m_currentSearch._visitedLocations.size();
|
||||
ImGui::Text("Locations Available: %zu / %zu", numAvailableLocations, numProgressionLocations);
|
||||
@@ -318,7 +318,7 @@ namespace dusk {
|
||||
|
||||
void ImGuiMenuRandomizer::generateLocationInfo() {
|
||||
auto trackerRando = getTrackerRando();
|
||||
auto locations = trackerRando->GetWorlds()[0]->GetAllLocations();
|
||||
auto locations = trackerRando->GetWorld()->GetAllLocations();
|
||||
|
||||
m_LocationInfo.clear();
|
||||
|
||||
|
||||
@@ -915,7 +915,7 @@ void parseObjPatchData(stage_tgsc_data_class& object, const YAML::Node& patchNod
|
||||
}
|
||||
}
|
||||
|
||||
RandomizerContext WriteSeedData(const std::unique_ptr<randomizer::logic::world::World>& world) {
|
||||
RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
|
||||
RandomizerContext randoData{};
|
||||
|
||||
// Settings we need to check ingame
|
||||
@@ -1248,7 +1248,7 @@ void GenerateAndWriteSeed(std::string& generationStatusMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& world = r.GetWorlds()[0];
|
||||
const auto world = r.GetWorld();
|
||||
RandomizerContext randoData{};
|
||||
try {
|
||||
randoData = WriteSeedData(world);
|
||||
|
||||
@@ -19,6 +19,15 @@
|
||||
|
||||
namespace randomizer
|
||||
{
|
||||
logic::world::World* Randomizer::GetWorld(int worldId /*= 1*/) {
|
||||
auto worldIndex = worldId - 1;
|
||||
if (worldIndex < this->_worlds.size()) {
|
||||
return this->_worlds.at(worldIndex).get();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::optional<std::string> Randomizer::Generate()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -23,6 +23,12 @@ namespace randomizer
|
||||
|
||||
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); }
|
||||
|
||||
Reference in New Issue
Block a user