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