You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
636 B
38 lines
636 B
package mightypork.rogue.bus;
|
|
|
|
|
|
import mightypork.rogue.AppAccess;
|
|
import mightypork.utils.control.interf.Destroyable;
|
|
|
|
|
|
/**
|
|
* App event bus client, to be used for subsystems, screens and anything that
|
|
* needs access to the eventbus
|
|
*
|
|
* @author MightyPork
|
|
*/
|
|
public abstract class Subsystem extends ChildClient implements Destroyable {
|
|
|
|
public Subsystem(AppAccess app) {
|
|
super(app);
|
|
|
|
bus().subscribe(this);
|
|
}
|
|
|
|
|
|
@Override
|
|
public final void destroy()
|
|
{
|
|
deinit();
|
|
|
|
bus().unsubscribe(this);
|
|
}
|
|
|
|
|
|
/**
|
|
* Deinitialize the subsystem<br>
|
|
* (called during destruction)
|
|
*/
|
|
protected abstract void deinit();
|
|
|
|
}
|
|
|