net.engio.mbassy.bus.error.IPublicationErrorHandler Java Examples

The following examples show how to use net.engio.mbassy.bus.error.IPublicationErrorHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MatchOne.java    From Entitas-Java with MIT License 4 votes vote down vote up
@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));
    }