template UEObjectSerialization()
enum UEObjectSerialization =
q{
private{
mixin generateObjectSerializeFunc!(serializeMember, UESerializer, "serialize");
mixin generateObjectSerializeFunc!(deserializeMember, UEDeserializer, "deserialize");
void serializeMember(T,M)(string m,ref M member, ref UESerializer serializer, UECustomFuncSerialize!M customFunc=null)
{
serializer.serializeObjectMember!(T,M)(this, m, member, customFunc);
}
void deserializeMember(T,M)(string m, ref M member, ref UEDeserializer serializer, UECustomFuncDeserialize!M customFunc=null)
{
serializer.deserializeObjectMember!(T,M)(this, this.instanceId.toString(), m, member, customFunc);
}
}
override void serialize(ref UESerializer serializer)
{
import unecht.core.hideFlags;
if(hideFlags.isSet(HideFlags.dontSaveInScene))
return;
alias T = typeof(this);
iterateAllSerializables!(T)(this, serializer);
super.serialize(serializer);
}
override void deserialize(ref UEDeserializer serializer, string uid=null)
{
super.deserialize(serializer,uid);
alias T = typeof(this);
iterateAllSerializables!(T)(this, serializer);
}
};