mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 03:23:15 +01:00
Fix formatting
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "StexObject.h"
|
||||
#include "WallObject.h"
|
||||
#include "WaterObject.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
interface IFileDataRetriever
|
||||
@@ -154,26 +155,23 @@ namespace ObjectFactory
|
||||
static Object* CreateObjectFromJson(
|
||||
IObjectRepository& objectRepository, const json_t* jRoot, const IFileDataRetriever* fileRetriever);
|
||||
|
||||
static uint8_t ParseSourceGame(const std::string &s)
|
||||
static uint8_t ParseSourceGame(const std::string& s)
|
||||
{
|
||||
static const std::unordered_map<std::string, uint8_t> LookupTable
|
||||
{
|
||||
{ "rct1", OBJECT_SOURCE_RCT1 },
|
||||
{ "rct1aa", OBJECT_SOURCE_ADDED_ATTRACTIONS },
|
||||
{ "rct1ll", OBJECT_SOURCE_LOOPY_LANDSCAPES },
|
||||
{ "rct2", OBJECT_SOURCE_RCT2 },
|
||||
{ "rct2ww", OBJECT_SOURCE_WACKY_WORLDS },
|
||||
{ "rct2tt", OBJECT_SOURCE_TIME_TWISTER },
|
||||
{ "official", OBJECT_SOURCE_OPENRCT2_OFFICIAL },
|
||||
{ "custom", OBJECT_SOURCE_CUSTOM },
|
||||
static const std::unordered_map<std::string, uint8_t> LookupTable{
|
||||
{ "rct1", OBJECT_SOURCE_RCT1 },
|
||||
{ "rct1aa", OBJECT_SOURCE_ADDED_ATTRACTIONS },
|
||||
{ "rct1ll", OBJECT_SOURCE_LOOPY_LANDSCAPES },
|
||||
{ "rct2", OBJECT_SOURCE_RCT2 },
|
||||
{ "rct2ww", OBJECT_SOURCE_WACKY_WORLDS },
|
||||
{ "rct2tt", OBJECT_SOURCE_TIME_TWISTER },
|
||||
{ "official", OBJECT_SOURCE_OPENRCT2_OFFICIAL },
|
||||
{ "custom", OBJECT_SOURCE_CUSTOM },
|
||||
};
|
||||
auto result = LookupTable.find(s);
|
||||
return (result != LookupTable.end()) ?
|
||||
result->second :
|
||||
OBJECT_SOURCE_CUSTOM;
|
||||
return (result != LookupTable.end()) ? result->second : OBJECT_SOURCE_CUSTOM;
|
||||
}
|
||||
|
||||
static void ReadObjectLegacy(Object * object, IReadObjectContext* context, IStream* stream)
|
||||
static void ReadObjectLegacy(Object* object, IReadObjectContext* context, IStream* stream)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -419,8 +417,7 @@ namespace ObjectFactory
|
||||
std::vector<uint8_t> sourceGameVector;
|
||||
for (size_t j = 0; j < json_array_size(sourceGames); j++)
|
||||
{
|
||||
sourceGameVector.push_back(
|
||||
ParseSourceGame(json_string_value(json_array_get(sourceGames, j))));
|
||||
sourceGameVector.push_back(ParseSourceGame(json_string_value(json_array_get(sourceGames, j))));
|
||||
}
|
||||
result->SetSourceGames(sourceGameVector);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user