Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/ComponentManagerSerialization.cpp
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 298 Lines • ▼ Show 20 Lines | try | ||||
DeserializeRNG(rng, m_RNG); | DeserializeRNG(rng, m_RNG); | ||||
deserializer.NumberU32_Unbounded("next entity id", m_NextEntityId); // TODO: use sensible bounds | deserializer.NumberU32_Unbounded("next entity id", m_NextEntityId); // TODO: use sensible bounds | ||||
uint32_t numSystemComponentTypes; | uint32_t numSystemComponentTypes; | ||||
deserializer.NumberU32_Unbounded("num system component types", numSystemComponentTypes); | deserializer.NumberU32_Unbounded("num system component types", numSystemComponentTypes); | ||||
ICmpTemplateManager* templateManager = NULL; | ICmpTemplateManager* templateManager = NULL; | ||||
CParamNode noParam; | CParamNode noParam(nullptr); | ||||
for (size_t i = 0; i < numSystemComponentTypes; ++i) | for (size_t i = 0; i < numSystemComponentTypes; ++i) | ||||
{ | { | ||||
std::string ctname; | std::string ctname; | ||||
deserializer.StringASCII("name", ctname, 0, 255); | deserializer.StringASCII("name", ctname, 0, 255); | ||||
ComponentTypeId ctid = LookupCID(ctname); | ComponentTypeId ctid = LookupCID(ctname); | ||||
if (ctid == CID__Invalid) | if (ctid == CID__Invalid) | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator