Groovy closure serialization

I am developing a game in Groovy, and I am considering using closures to make clean architecture. For example, to implement status effects (for example, poisoning), the Player object will have a closure list for each game move. When saving the game, they must be serialized.

Is it usually a good idea to store closures in objects that require serialization? Or should I choose a more traditional architecture (e.g. keep a list of StatusEffect objects)?

+5
source share
1 answer

With a list of closures for each game, the sound sounds like a really good idea :-)

. Groovy 1.8.5, , dehydrate rehydrate Closures ( owner, thisObject delegate )

Java- . ( thrift)

, , ? poisoned, , , , . , ( ). , , HP , ; -)

, , , , , , .., , .

+4
source

All Articles