Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support editing components #27

Closed
randomPoison opened this issue Oct 19, 2018 · 0 comments
Closed

Support editing components #27

randomPoison opened this issue Oct 19, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@randomPoison
Copy link
Member

randomPoison commented Oct 19, 2018

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 🙂

@randomPoison randomPoison added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 20, 2018
@randomPoison randomPoison added this to the Version 0.3 milestone Oct 20, 2018
@randomPoison randomPoison removed help wanted Extra attention is needed labels Oct 20, 2018
@randomPoison randomPoison self-assigned this Oct 22, 2018
@randomPoison randomPoison moved this from To do to In progress in Runtime editing support Oct 22, 2018
Runtime editing support automation moved this from In progress to Done Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Development

No branches or pull requests

1 participant