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