My data is encapsulated via components attached to entities (ECS). For client/server communication i need to serialize a set of struct components for any given entity so i can compress and send over the wire.
Since each component is a unique type, and Memorypack does not output type information, I wanted to solve by using a union on some interface my struct components could implement, but noticed the compiler error noting class only support for unions.
So:
Is it possible to get union working with structs? Assuming not, then:
Is there a recommended workaround or alternative for this use case?
My data is encapsulated via components attached to entities (ECS). For client/server communication i need to serialize a set of struct components for any given entity so i can compress and send over the wire.
Since each component is a unique type, and Memorypack does not output type information, I wanted to solve by using a union on some interface my struct components could implement, but noticed the compiler error noting class only support for unions.
So:
Many thanks.