You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue references work that is in ticket #26. It isn't fully blocked by that ticket, but it might be easier to do once #26 is finished.
Following the examples set for #25 and #26 we should also add support for editing components. The following things need to be done to enable such support:
Add a new variant to IncomingMessage called ComponentUpdate that contains the ID for the component type, the entity the component is attached to (as a SerializableEntity), and the data for the component (as a serde_json::Value).
Rename SyncComponentSystem to ReadComponentSystem and move it into it's own read_component module.
Make a new System WriteComponentSystem mirroring WriteResourceSystem and put it in a new write_component module.
Rename ComponentSet to ReadComponentSet.
Add a new trait WriteComponentSet in the type_set module mirroring the WriteResourceSet trait (which should be created for Register read-only resources #26).
Rename SyncEditorSystem::deserializer_map to resource_deserializer_map and update SyncEditorBundle accordingly.
Add a member component_deserializer_map to SyncEditorSystem that mirrors resource_deserializer_map. It should take the Component ID (i.e. the name used when registering the component) and map it to a Sender<(Entity, serde_json::Value)>. The corresponding WriteComponentSystem should have the Receiver end of the channel.
Update SyncComponentBundle::sync_component and sync_components to require that the registered types be Serialize + DeserializeOwned (or ReadComponentSet + WriteComponentSet in the case of sync_components.
Add methods read_component and read_components to SyncComponentsBundle that only require the types to be Serialize/ReadComponentSet.
Note that these steps assume that #26 has been completed. If this is being done before #26, you can still follow all the steps here, however you may need read #26 to understand the details for how to support read-only components (i.e. needing both a ReadComponentSet and a WriteComponentSet trait).
I'm happy to answer any questions or offer mentorship for anyone who wants to take on this task 🙂
The text was updated successfully, but these errors were encountered:
Following the examples set for #25 and #26 we should also add support for editing components. The following things need to be done to enable such support:
IncomingMessage
calledComponentUpdate
that contains the ID for the component type, the entity the component is attached to (as aSerializableEntity
), and the data for the component (as aserde_json::Value
).SyncComponentSystem
toReadComponentSystem
and move it into it's ownread_component
module.WriteComponentSystem
mirroringWriteResourceSystem
and put it in a newwrite_component
module.ComponentSet
toReadComponentSet
.WriteComponentSet
in thetype_set
module mirroring theWriteResourceSet
trait (which should be created for Register read-only resources #26).SyncEditorSystem::deserializer_map
toresource_deserializer_map
and updateSyncEditorBundle
accordingly.component_deserializer_map
toSyncEditorSystem
that mirrorsresource_deserializer_map
. It should take the Component ID (i.e. the name used when registering the component) and map it to aSender<(Entity, serde_json::Value)>
. The correspondingWriteComponentSystem
should have theReceiver
end of the channel.SyncComponentBundle::sync_component
andsync_components
to require that the registered types beSerialize + DeserializeOwned
(orReadComponentSet + WriteComponentSet
in the case ofsync_components
.read_component
andread_components
toSyncComponentsBundle
that only require the types to beSerialize
/ReadComponentSet
.Note that these steps assume that #26 has been completed. If this is being done before #26, you can still follow all the steps here, however you may need read #26 to understand the details for how to support read-only components (i.e. needing both a
ReadComponentSet
and aWriteComponentSet
trait).I'm happy to answer any questions or offer mentorship for anyone who wants to take on this task 🙂
The text was updated successfully, but these errors were encountered: