Search in sources :

Example 1 with MBassador

use of net.engio.mbassy.bus.MBassador in project Entitas-Java by Rubentxu.

the class Examples method create.

@Override
public void create() {
    engine = new ExamplesEngine();
    entitas = new Entitas();
    preferencesManager.LOG_LEVEL = LogManager.LOG_DEBUG;
    AssetManager assetsManager = new AssetManager(new TestFileHandleResolver());
    engine.addManager(new AssetsManagerGDX(assetsManager, preferencesManager));
    engine.addManager(new PhysicsManagerGDX(new Vector2(0, -9.8f)));
    engine.addManager(new GUIManagerGDX(new ScreenViewport(), new BitmapFont(), engine));
    engine.addManager(new SceneManagerGDX(engine, entitas));
    engine.addManager(new LogManagerGDX(preferencesManager));
    engine.addManager(new InputManagerGDX(entitas, engine));
    engine.addManager(preferencesManager);
    game = new ExamplesGame(engine, new EventBusGDX(new MBassador()));
    game.init();
    game.pushState(new PlatformExampleState(engine, entitas));
}
Also used : AssetManager(com.badlogic.gdx.assets.AssetManager) TestFileHandleResolver(com.examples.games.util.TestFileHandleResolver) ScreenViewport(com.badlogic.gdx.utils.viewport.ScreenViewport) MBassador(net.engio.mbassy.bus.MBassador) EventBusGDX(ilargia.egdx.impl.EventBusGDX) PlatformExampleState(com.examples.games.states.PlatformExampleState) Vector2(com.badlogic.gdx.math.Vector2) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont) Entitas(ilargia.egdx.logicbricks.gen.Entitas)

Example 2 with MBassador

use of net.engio.mbassy.bus.MBassador in project Entitas-Java by Rubentxu.

the class MatchOne method create.

@Override
public void create() {
    AssetManager assetsManager = new AssetManager(new TestFileHandleResolver());
    BasePreferencesManager preferencesManager = new BasePreferencesManager();
    MatchOneEngine engine = new MatchOneEngine();
    engine.addManager(new BaseAssetsManager(assetsManager, preferencesManager));
    //        new Collections(new CollectionsFactory() {
    //            @Override
    //            public <T> List<T> createList(Class<T> clazz) {
    //                if (clazz.equals(Integer.class))
    //                    return (List<T>) new IntArrayList();
    //                else
    //                    return new ObjectArrayList();
    //            }
    //
    //            @Override
    //            public <T> Set createSet(Class<T> clazz) {
    //                if (clazz.equals(Integer.class))
    //                    return new IntArraySet();
    //                else
    //                    return new ObjectOpenHashSet();
    //        }
    //
    //            @Override
    //            public <K, V> Map createMap(Class<K> keyClazz, Class<V> valueClazz) {
    //                return new Object2ObjectArrayMap();
    //            }
    //
    //
    //        });
    new EntitasCollections(new CollectionsFactories() {
    });
    MBassador bus = new MBassador(new IPublicationErrorHandler() {

        @Override
        public void handleError(PublicationError error) {
            Gdx.app.error("EBUS ERROR: ", error.toString());
        }
    });
    game = new MatchOneGame(engine, new EGEventBus(bus));
    game.init();
    game.pushState(new MatchOneState(engine));
}
Also used : CollectionsFactories(com.ilargia.games.entitas.factories.CollectionsFactories) AssetManager(com.badlogic.gdx.assets.AssetManager) TestFileHandleResolver(com.indignado.games.util.TestFileHandleResolver) PublicationError(net.engio.mbassy.bus.error.PublicationError) MatchOneState(com.indignado.games.states.MatchOneState) MBassador(net.engio.mbassy.bus.MBassador) BaseAssetsManager(com.ilargia.games.entitas.egdx.base.managers.BaseAssetsManager) EntitasCollections(com.ilargia.games.entitas.factories.EntitasCollections) BasePreferencesManager(com.ilargia.games.entitas.egdx.base.managers.BasePreferencesManager) IPublicationErrorHandler(net.engio.mbassy.bus.error.IPublicationErrorHandler) EGEventBus(com.ilargia.games.entitas.egdx.EGEventBus)

Example 3 with MBassador

use of net.engio.mbassy.bus.MBassador in project Entitas-Java by Rubentxu.

the class Pong method create.

@Override
public void create() {
    AssetManager assetsManager = new AssetManager(new TestFileHandleResolver());
    BasePreferencesManager preferencesManager = new BasePreferencesManager();
    PongEngine engine = new PongEngine();
    engine.addManager(new BaseAssetsManager(assetsManager, preferencesManager));
    engine.addManager(new BasePhysicsManager(new Vector2(0, 0)));
    engine.addManager(new BaseGUIManager(new BitmapFont(), null, engine));
    engine.addManager(new BaseSceneManager(engine));
    game = new PongGame(engine, new EGEventBus(new MBassador()));
    game.init();
    game.pushState(new PongState(engine));
}
Also used : AssetManager(com.badlogic.gdx.assets.AssetManager) PongState(com.indignado.games.states.PongState) TestFileHandleResolver(com.indignado.games.util.TestFileHandleResolver) MBassador(net.engio.mbassy.bus.MBassador) Vector2(com.badlogic.gdx.math.Vector2) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont) EGEventBus(com.ilargia.games.entitas.egdx.EGEventBus)

Aggregations

AssetManager (com.badlogic.gdx.assets.AssetManager)3 MBassador (net.engio.mbassy.bus.MBassador)3 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)2 Vector2 (com.badlogic.gdx.math.Vector2)2 EGEventBus (com.ilargia.games.entitas.egdx.EGEventBus)2 TestFileHandleResolver (com.indignado.games.util.TestFileHandleResolver)2 ScreenViewport (com.badlogic.gdx.utils.viewport.ScreenViewport)1 PlatformExampleState (com.examples.games.states.PlatformExampleState)1 TestFileHandleResolver (com.examples.games.util.TestFileHandleResolver)1 BaseAssetsManager (com.ilargia.games.entitas.egdx.base.managers.BaseAssetsManager)1 BasePreferencesManager (com.ilargia.games.entitas.egdx.base.managers.BasePreferencesManager)1 CollectionsFactories (com.ilargia.games.entitas.factories.CollectionsFactories)1 EntitasCollections (com.ilargia.games.entitas.factories.EntitasCollections)1 MatchOneState (com.indignado.games.states.MatchOneState)1 PongState (com.indignado.games.states.PongState)1 EventBusGDX (ilargia.egdx.impl.EventBusGDX)1 Entitas (ilargia.egdx.logicbricks.gen.Entitas)1 IPublicationErrorHandler (net.engio.mbassy.bus.error.IPublicationErrorHandler)1 PublicationError (net.engio.mbassy.bus.error.PublicationError)1