-
-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
- Simple Data - Compound Data - DataBuilder - DataContentUpdater - DataTranslator - Keys
dm.register(FriendsDataImpl.class, ImmutableFriendsDataImpl.class, new FriendsDataBuilder()); | ||
|
||
// Home | ||
dm.registerBuilder(Home.class, new HomeBuilder()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should note that Home
as a DataSerializable
should be registered before any data manipulator that relies on it can be registered. The reasoning is that in SpongePowered/SpongeAPI#1198, the system will need to know of all of the serializable objects and translatable objects before it can generate the appropriate serialization strategies for custom data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any error or exception if they arn't? having the check would help developers catch this mistake in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd imagine that there'll be logic along the lines of:
for value in values:
if value.obj is dataserialiable:
toContainer
if value.obj is primitive, map, list
set directly
if value.obj has registered translator:
get translator, translate
throw RuntimeException of some form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is more about generating he deserialization methods with class generation.
I'll be making another PR for data 2.0 for docs and cookbook so that we On Tue., 8 Nov. 2016, 6:30 am Gabriel Harris-Rouquette, <
|
Hey, could this be merged? At the moment there's a dead link in the Docs as I was expecting for this to be pulled. Let me know if there's something that needs to be changed. |
Bump. See Zephires comment above mine. The link on the docs is (still) broken. |
Built as a complete example for SpongeDocs#532
Should cover everything that #16 covers and more.