Rework Serialization functions
add name and handle more types
This commit is contained in:
@@ -507,16 +507,16 @@ namespace Nz
|
||||
template<typename T>
|
||||
bool Serialize(SerializationContext& context, const Sphere<T>& sphere, TypeTag<Sphere<T>>)
|
||||
{
|
||||
if (!Serialize(context, sphere.x))
|
||||
if (!Serialize(context, "x", sphere.x))
|
||||
return false;
|
||||
|
||||
if (!Serialize(context, sphere.y))
|
||||
if (!Serialize(context, "y", sphere.y))
|
||||
return false;
|
||||
|
||||
if (!Serialize(context, sphere.z))
|
||||
if (!Serialize(context, "z", sphere.z))
|
||||
return false;
|
||||
|
||||
if (!Serialize(context, sphere.radius))
|
||||
if (!Serialize(context, "radius", sphere.radius))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -532,16 +532,16 @@ namespace Nz
|
||||
template<typename T>
|
||||
bool Unserialize(SerializationContext& context, Sphere<T>* sphere, TypeTag<Sphere<T>>)
|
||||
{
|
||||
if (!Unserialize(context, &sphere->x))
|
||||
if (!Unserialize(context, "x", &sphere->x))
|
||||
return false;
|
||||
|
||||
if (!Unserialize(context, &sphere->y))
|
||||
if (!Unserialize(context, "y", &sphere->y))
|
||||
return false;
|
||||
|
||||
if (!Unserialize(context, &sphere->z))
|
||||
if (!Unserialize(context, "z", &sphere->z))
|
||||
return false;
|
||||
|
||||
if (!Unserialize(context, &sphere->radius))
|
||||
if (!Unserialize(context, "radius", &sphere->radius))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user