Rework Serialization functions

add name and handle more types
This commit is contained in:
SweetId
2024-03-05 17:26:07 -05:00
parent 055634e77c
commit a0f2b128d7
28 changed files with 645 additions and 336 deletions

View File

@@ -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;