7071727374757677787980
Bus bus = bus(); Collection<State> states = new LinkedList<State>(); states.add(gameState()); states.add(menuState()); StateManager stateManager = new StateManager(states); bus.register(stateManager, null); bus.broadcast(new StateChange(MenuState.class)); return stateManager; }
8788899091929394959697
} public @Bean GameLauncher gameLauncher() { Bus bus = bus(); GameLauncher gameLauncher = new GameLauncher(bus(), gameState()); bus.register(gameLauncher, null); return gameLauncher; } public @Bean Engine engine() { PropertiesAccessor propertiesAccessor = propertiesAccessor();
3738394041424344454647
UUID entityId = UUID.randomUUID(); Foo fooOne = new Foo(bus, entityId); bus.register(fooOne, entityId); bus.send("blah", entityId); assertEquals("blah", fooOne.fooValue); fooOne.fooValue = null;
6667686970717273747576
UUID entityId = UUID.randomUUID(); Bar bar = new Bar(bus, entityId); bus.register(bar, entityId); bus.broadcast("blah"); assertEquals("blah", bar.fooValue); assertEquals("blah", bar.barValue);