/** * @param args Command-line arguments */ public static void main(String[] args) { final Injector injector = Guice.createInjector( new MotherBrainModule(), new LoggableInputListenerModule(), new StateManagerModule() ); final MotherBrain motherBrain = injector.getInstance(MotherBrain.class); final InputListener basicInputListener = injector.getInstance(LoggableInputListener.class); motherBrain.setInputListener(basicInputListener); motherBrain.start(); }
@Override protected void configure() { bind(InputListener.class).to(BasicInputListener.class).in(Singleton.class); }
@Override protected void configure() { bind(InputListener.class).to(LoggableInputListener.class).in(Singleton.class); }
@Override public void setInputListener(InputListener inputListener) { this.inputListener = inputListener; }
/** * Set the input listener to be added on init * * @param listener The listener to be added on init */ public void setListener(InputListener listener) { this.listener = listener; }
/** * * @param inputListener inputListener */ void setInputListener(InputListener inputListener);