amethyst / editor-core

Crate that allows an Amethyst game to communicate with an editor.
Other
44 stars 10 forks source link

Easier registering of many types #21

Closed mvesterli closed 6 years ago

mvesterli commented 6 years ago

A solution to #19 and #20.

The syntax would be

let components = type_set![Foo, Bar];
let bundle = SyncEditorBundle::new()
    .sync_default_types()
    .sync_components(&components);

This is more flexible than using a macro to construct the bundle itself. For example it makes it easy to switch between different sets of synced types.

randomPoison commented 6 years ago

I like this approach! I should be able to review and merge some time in the next day or so 🙂

mvesterli commented 6 years ago

Sorry for the delay, I've been a bit busy. It's only a breaking change in that it changes the type of the bundle. But as long as the type is inferred, I don't think it will be a problem.

randomPoison commented 6 years ago

Thanks for updating! I agree that it's probably not really a breaking change, especially considering that the full type for SyncEditorBundle is so complex that it's impractical to not use type inference. Looks like you just have some conflicts to fix, but then I'll be happy to get this merged 🙂

randomPoison commented 6 years ago

Thanks for all your hard work on this!