junkdog / artemis-odb

A continuation of the popular Artemis ECS framework
BSD 2-Clause "Simplified" License
776 stars 111 forks source link

remove WorldConfigurationBuilder.withPassive #449

Closed CreamyCookie closed 7 years ago

CreamyCookie commented 8 years ago

WorldConfigurationBuilder.with is identical to WorldConfigurationBuilder.withPassive and passive systems have been removed.

public WorldConfigurationBuilder withPassive(int priority, BaseSystem... systems) {

btw. Why were passive systems removed and how can I achieve the same now?

junkdog commented 8 years ago

WorldConfigurationBuilder.with is identical to WorldConfigurationBuilder.withPassive and passive systems have been removed.

oops, that shouldn't be there anymore.

btw. Why were passive systems removed and how can I achieve the same now?

SystemInvocationStrategy allows more sophisticated execution flows. why do you want passive systems?

CreamyCookie commented 8 years ago

SystemInvocationStrategy allows more sophisticated execution flows. why do you want passive systems?

Basically I want to seperate logic and render systems so I can implement something like deWiTTERS Game Loop. I've seen TomGrill/logic-render-game-loop, but I'm not too happy to have my game loop inside an InvocationStrategy subclass. I'd rather let my LibGDX game loop control artemis, but I guess I can do everything inside a system instead of in the screen class. I'll try for now if everything works out with InvocationStrategy.

Another question: How do you pass context like the Game managing the screens to the systems? A singleton or just an interface containing a setContext method, that systems implement?

junkdog commented 8 years ago

Well, you could write an InvocationStrategy so that it's only explicitly invoked.

Another question: How do you pass context like the Game managing the screens to the systems?

Register the object with the DI:

Director director = ...;
WorldConfiguration wc = new WorldConfiguration();
wc.register(director);

// and so on

then, in your systems:

@Wire
private Director director;
CreamyCookie commented 8 years ago

Well, you could write an InvocationStrategy so that it's only explicitly invoked.

Yeah, that's true. I try to keep that in mind if issues arise.

Register the object with the DI:

Ah.. good idea. Thank you! :)

junkdog commented 8 years ago

you can also name instance, if you to register multiple instances: https://github.com/junkdog/artemis-odb/wiki/@Wire

junkdog commented 8 years ago

(feel free to re-open if you have more questions)

CreamyCookie commented 8 years ago

@junkdog Cool, thanks, but isn't withPassive still there? (Also it seems like I couldn't reopen it, even if I wanted, weirdly enough.. I'm pretty sure that worked in the past though.)