Serializable component

You can remove the component to tell Concord an Entity shouldn't be serialized.

It's given automatically on Entity creation, but this can be disabled by changing Entity.SERIALIZE_BY_DEFAULT to false.
This commit is contained in:
Pablo Ariel Mayobre 2023-02-14 18:14:24 -03:00
parent 892f4d4700
commit cc0fd1614c
4 changed files with 32 additions and 4 deletions

View file

@ -323,9 +323,10 @@ function World:serialize()
for i = 1, self.__entities.size do
local entity = self.__entities[i]
local entityData = entity:serialize()
data[i] = entityData
if entity.serializable then
local entityData = entity:serialize()
table.insert(data, entityData)
end
end
return data