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

@@ -217,16 +217,10 @@ namespace Nz
template<typename T>
bool Serialize(SerializationContext& context, const OrientedBox<T>& obb, TypeTag<OrientedBox<T>>)
{
if (!Serialize(context, obb.localBox))
if (!Serialize(context, "localBox", obb.localBox))
return false;
for (auto&& corner : obb.m_corners)
{
if (!Serialize(context, corner))
return false;
}
return true;
return Serialize(context, "corners", obb.m_corners);
}
/*!
@@ -239,16 +233,10 @@ namespace Nz
template<typename T>
bool Unserialize(SerializationContext& context, OrientedBox<T>* obb, TypeTag<OrientedBox<T>>)
{
if (!Unserialize(context, &obb->localBox))
if (!Unserialize(context, "localBox", &obb->localBox))
return false;
for (auto&& corner : obb->m_corners)
{
if (!Unserialize(context, &corner))
return false;
}
return true;
return Unserialize(context, "corners", &obb->m_corners);
}
/*!