parent
5e79c3ac03
commit
5e35bfe958
@ -0,0 +1,54 @@ |
||||
package mightypork.gamecore.control; |
||||
|
||||
|
||||
import mightypork.gamecore.audio.SoundSystem; |
||||
import mightypork.gamecore.input.InputSystem; |
||||
import mightypork.gamecore.render.DisplaySystem; |
||||
|
||||
|
||||
/** |
||||
* App event bus client, to be used for subsystems, screens and anything that |
||||
* needs access to the eventbus |
||||
* |
||||
* @author MightyPork |
||||
*/ |
||||
public abstract class AppSubModule extends BusNode implements AppAccess { |
||||
|
||||
private final AppAccess app; |
||||
|
||||
|
||||
public AppSubModule(AppAccess app) { |
||||
super(app); |
||||
|
||||
this.app = app; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public final SoundSystem snd() |
||||
{ |
||||
return app.snd(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public final InputSystem input() |
||||
{ |
||||
return app.input(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public final DisplaySystem disp() |
||||
{ |
||||
return app.disp(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void shutdown() |
||||
{ |
||||
app.shutdown(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,35 @@ |
||||
package mightypork.gamecore.control; |
||||
|
||||
import mightypork.gamecore.control.interf.Destroyable; |
||||
|
||||
|
||||
/** |
||||
* Bus node that should be directly attached to the bus. |
||||
* |
||||
* @author MightyPork |
||||
*/ |
||||
public abstract class RootBusNode extends BusNode implements Destroyable { |
||||
|
||||
public RootBusNode(BusAccess busAccess) { |
||||
super(busAccess); |
||||
|
||||
bus().subscribe(this); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public final void destroy() |
||||
{ |
||||
deinit(); |
||||
|
||||
bus().unsubscribe(this); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Deinitialize the subsystem<br> |
||||
* (called during destruction) |
||||
*/ |
||||
protected abstract void deinit(); |
||||
|
||||
} |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.render; |
||||
package mightypork.gamecore.gui.renderers; |
||||
|
||||
|
||||
/** |
Loading…
Reference in new issue