How to add and remove system bundle?

(Lightnet) #1

I been trying to look into how add and remove system bundle in gamestate or examplestate?

let game_data = CustomGameDataBuilder::default()

The reason is was looking how network is setup by using the system but need option to set to host or client as well to remove. Not sure how dispatcher works.


Any idea how do this? I wanted to use the menu ui to test it.

(Azriel Hoh) #2

Heya, it’s not possible to remove bundles (or systems) from the dispatcher. You could:

  • have a parameter in the state constructor, where you pass in something which says which bundles to add, or
  • have two separate states, one for the host and one for the client.
1 Like
(Lightnet) #3

Oh, I see. Does dispatcher handler work like array list to remove or it not possible?

(Azriel Hoh) #4

shred is the underlying library that provides the Dispatcher and System types.

The Dispatcher holds execution stages, and each Stage holds the systems. Currently Stage doesn’t provide any API to add/remove systems once the Dispatcher has been built. It may be much harder to implement that (with a good API) than to go with building a new dispatcher based on some value passed when the menu UI button is clicked.

1 Like