Search in sources :

Example 1 with PublicationError

use of net.engio.mbassy.bus.error.PublicationError 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)

Aggregations

AssetManager (com.badlogic.gdx.assets.AssetManager)1 EGEventBus (com.ilargia.games.entitas.egdx.EGEventBus)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 TestFileHandleResolver (com.indignado.games.util.TestFileHandleResolver)1 MBassador (net.engio.mbassy.bus.MBassador)1 IPublicationErrorHandler (net.engio.mbassy.bus.error.IPublicationErrorHandler)1 PublicationError (net.engio.mbassy.bus.error.PublicationError)1