Closed bryanbrunt closed 2 years ago
Are you sure @Transient
doesn't work on fields? Glancing over the Json code it does check for it.
Alternatively, there is a pattern used for non-serialized state that you want to populate after loading: https://github.com/junkdog/artemis-odb/wiki/Model-for-Serialization
Are you sure
@Transient
doesn't work on fields? Glancing over the Json code it does check for it.
@Transient
public Object controller;
There is a compile error when using the Transient tag inside of a class.
error: annotation type not applicable to this kind of declaration @Transient
The @Transient
I'm thinking of is javax.persistence.Transient
which doesn't apply in odb, oops.
Try the java modifier. public transient Object controller;
Added wiki page. Thanks for the question. https://github.com/junkdog/artemis-odb/wiki/How-to-avoid-serializing-specific-components-or-fields
Added wiki page. Thanks for the question. https://github.com/junkdog/artemis-odb/wiki/How-to-avoid-serializing-specific-components-or-fields
Nice! I was about to ask where this is documented.
Daan, it would be great if you could put a load and save game system into one of your games.
As far as I know, there is no simple existing example for Artemis ODB in the entire universe.
On the libgdx discord, I like to point people to your games, but there's nothing on loading and saving games to point people to.
Daan, it would be great if you could put a load and save game system into one of your games.
I'll see if I can fit it in somewhere.
I have been assigning controller classes to my Components like this:
These controller classes separate the game logic from the Components which are purely data.
Is there anyway with artemis to not serialize these Objects without writing a custom serializer?
It seems like Artemis should have a @Transient tag that applies to just properties of Components.