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