1
0
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:
ζeh Matt
2021-11-24 19:41:48 +02:00
parent cf27c4a024
commit 3563d89e58

View File

@@ -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);