mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 04:23:20 +01:00
Add TIdentifier specialization to GameAction visitor
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "../Game.h"
|
||||
#include "../common.h"
|
||||
#include "../core/DataSerialiser.h"
|
||||
#include "../core/Identifier.hpp"
|
||||
#include "../localisation/StringIds.h"
|
||||
#include "GameActionResult.h"
|
||||
|
||||
@@ -86,6 +87,13 @@ public:
|
||||
param = static_cast<T>(value);
|
||||
}
|
||||
|
||||
template<typename T, T TNull, typename TTag> void Visit(std::string_view name, TIdentifier<T, TNull, TTag>& param)
|
||||
{
|
||||
auto value = param.ToUnderlying();
|
||||
Visit(name, value);
|
||||
param = TIdentifier<T, TNull, TTag>::FromUnderlying(value);
|
||||
}
|
||||
|
||||
template<typename T, size_t _TypeID> void Visit(std::string_view name, NetworkObjectId_t<T, _TypeID>& param)
|
||||
{
|
||||
Visit(name, param.id);
|
||||
|
||||
Reference in New Issue
Block a user