Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpRangeManager.cpp
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | |||||
cassert(sizeof(EntityData) == 24); | cassert(sizeof(EntityData) == 24); | ||||
/** | /** | ||||
* Serialization helper template for Query | * Serialization helper template for Query | ||||
*/ | */ | ||||
struct SerializeQuery | struct SerializeQuery | ||||
{ | { | ||||
template<typename S> | template<typename S, typename T> | ||||
void Common(S& serialize, const char* UNUSED(name), Query& value) | void Common(S& serialize, const char* UNUSED(name), T& value) | ||||
{ | { | ||||
serialize.Bool("enabled", value.enabled); | serialize.Bool("enabled", value.enabled); | ||||
serialize.Bool("parabolic",value.parabolic); | serialize.Bool("parabolic",value.parabolic); | ||||
serialize.NumberFixed_Unbounded("min range", value.minRange); | serialize.NumberFixed_Unbounded("min range", value.minRange); | ||||
serialize.NumberFixed_Unbounded("max range", value.maxRange); | serialize.NumberFixed_Unbounded("max range", value.maxRange); | ||||
serialize.NumberFixed_Unbounded("elevation bonus", value.elevationBonus); | serialize.NumberFixed_Unbounded("elevation bonus", value.elevationBonus); | ||||
serialize.NumberU32_Unbounded("owners mask", value.ownersMask); | serialize.NumberU32_Unbounded("owners mask", value.ownersMask); | ||||
serialize.NumberI32_Unbounded("interface", value.interface); | serialize.NumberI32_Unbounded("interface", value.interface); | ||||
SerializeVector<SerializeU32_Unbounded>()(serialize, "last match", value.lastMatch); | SerializeVector<SerializeU32_Unbounded>()(serialize, "last match", value.lastMatch); | ||||
serialize.NumberU8_Unbounded("flagsMask", value.flagsMask); | serialize.NumberU8_Unbounded("flagsMask", value.flagsMask); | ||||
} | } | ||||
void operator()(ISerializer& serialize, const char* name, Query& value, const CSimContext& UNUSED(context)) | void operator()(ISerializer& serialize, const char* name, const Query& value, const CSimContext& UNUSED(context)) | ||||
{ | { | ||||
Common(serialize, name, value); | Common(serialize, name, value); | ||||
uint32_t id = value.source.GetId(); | uint32_t id = value.source.GetId(); | ||||
serialize.NumberU32_Unbounded("source", id); | serialize.NumberU32_Unbounded("source", id); | ||||
} | } | ||||
void operator()(IDeserializer& deserialize, const char* name, Query& value, const CSimContext& context) | void operator()(IDeserializer& deserialize, const char* name, Query& value, const CSimContext& context) | ||||
▲ Show 20 Lines • Show All 2,202 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator