23 lines
543 B
C++
23 lines
543 B
C++
#include <Entity/Entity.h>
|
|
|
|
#include <Core/Common/serialization.h>
|
|
|
|
DEFINE_CLASS_VERSIONED(Entity, 1, nullptr, nullptr)
|
|
|
|
DEFINE_ENTITY_VERSIONED(Inert, 1, nullptr)
|
|
|
|
void serialize(Archive& ar, NonNullPtr<Entity> entity)
|
|
{
|
|
// Entity fields
|
|
serialize(ar, Entity::kind, entity.Get());
|
|
|
|
SERIALIZE(ar, id, entity->ID);
|
|
SERIALIZE(ar, position, entity->position);
|
|
|
|
// Derived fields
|
|
if (entity->derived_kind != nullptr && entity->derived != nullptr)
|
|
{
|
|
serialize(ar, entity->derived_kind, entity->derived);
|
|
}
|
|
}
|