Closed uzytkownik closed 1 year ago
I have not seen a use case for this so far. Can you explain what you want the possibility to configure a loading state across multiple plugins for? In my own code bases, I would like them to be configured in one plugin to make it easier to follow.
The biggest pain point I would have with this kind of API is that the user needs to remember to call complete_loading
and that the actual content of the loading state then depends on the order of user plugins (since they can all try to add new collections to a state).
I divided my game (toy but I'm trying to do it properly) into files and treat each component as plugin. So player is a plugin, mob is a plugin, board is a plugin etc.
So you want to add the collections concerning the player in the player plugin, the board in the board plugin and so on? This should already be possible. You can add identical loading states with different collections and they will get combined.
I missed this from documentation. Can it be treated as documentation bug then?
Yes, I can add that to the readme and consider this issue closed as soon as the functionality is documented.
Currently the only (official) way to describe the loading transitions is from
fn main
function. For bigger projects, from what I understand, plugins are often used.I wrote very quick'n'dirty proof-of-concept:
(It would probably be able to expose simpler interface if
LoadingState
changed fromfn foo(self) -> Self
tofn foo(&mut self) -> &mut Self
).This way the loading can be constructed as:
(I suspect that
complete_loading
can be avoided with 'native' loading)