Make use of custom functions when converting menus

This commit is contained in:
Jan
2021-12-28 23:52:42 +01:00
parent 338de302d9
commit 7188b0946d
27 changed files with 459 additions and 143 deletions

View File

@ -37,6 +37,7 @@ public:
return dynamic_cast<T*>(foundEntry->second.get());
auto newState = std::make_unique<T>();
newState->SetZone(m_zone);
auto* newStatePtr = newState.get();
m_zone_asset_loader_states.emplace(std::make_pair<std::type_index, std::unique_ptr<IZoneAssetLoaderState>>(typeid(T), std::move(newState)));
return newStatePtr;

View File

@ -1,4 +1,5 @@
#pragma once
#include "Zone/Zone.h"
class IZoneAssetLoaderState
{
@ -11,4 +12,9 @@ public:
IZoneAssetLoaderState(IZoneAssetLoaderState&& other) noexcept = default;
IZoneAssetLoaderState& operator=(const IZoneAssetLoaderState& other) = default;
IZoneAssetLoaderState& operator=(IZoneAssetLoaderState&& other) noexcept = default;
};
virtual void SetZone(Zone* zone)
{
// Do nothing by default
}
};