public class ClassMapping
extends ClassSerializer
This class implements custom class mapping. There are three advantages in
using a custom serializer here:
(1) the approach is constructive instead of destructive, that is to say,
only marked fields will be taken. Granted, this is mostly coding style
related, but this prevent introduction of useless serialized data by
mistake.
(2) we can introduce specific serialized types. For example (although not
yet implemented?) we will be able to implement a tile as a reference to
this tile through e.g. {x, y, z}, that is know what needs to be serialized,
know what needs to be referenced, and how to reference it.
(3) again, not yet implemented, but we can in theory have different set
of serialization depending on the context.
HISTORY NOTE
This was initially developed because the initial network framework only
allowed for byte, float and int, so more things were needed. To the light
of current understanding, using only byte would have been good enough.
It seems like the three points above indeed give more value and safety to
the whole code and make this system still relevant. To be re-evaluated.
QUESTION ON OBJECTS
At the moment, we do not support object creation from this interface, so
the objects are supposed to be already there and then updated. This may
not always make sense, in particular in the context of RPC
Non-null arrays of objects are forbidden as well, and they need to be set
to the same null and non-null elements on both sides.