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

@@ -282,10 +282,10 @@ namespace Nz
template<typename T>
bool Serialize(SerializationContext& context, const Plane<T>& plane, TypeTag<Plane<T>>)
{
if (!Serialize(context, plane.normal))
if (!Serialize(context, "normal", plane.normal))
return false;
if (!Serialize(context, plane.distance))
if (!Serialize(context, "distance", plane.distance))
return false;
return true;
@@ -301,10 +301,10 @@ namespace Nz
template<typename T>
bool Unserialize(SerializationContext& context, Plane<T>* plane, TypeTag<Plane<T>>)
{
if (!Unserialize(context, &plane->normal))
if (!Unserialize(context, "normal", &plane->normal))
return false;
if (!Unserialize(context, &plane->distance))
if (!Unserialize(context, "distance", &plane->distance))
return false;
return true;