public WorldRoom(Tilemap map) { this.destroyed = false; this.prepared = false; this.events = new EventHelper(this); this.bodyQueue = new ObjectSet<>(); this.entrypointQueue = new ObjectSet<>(); this.tilemap = map; this.controller = null; this.obj = new ObjectSet<>(); this.entrypoints = new ObjectMap<>(); this.opacityMapping = new IntFloatMap(); this.collisionLayers = new ObjectMap<>(); this.renderOrder = new Array<>(true, 16); this.disabledCollision = new ObjectSet<>(); }
public void write (Kryo kryo, Output output, IntFloatMap map) { int length = map.size; output.writeVarInt(length, true); for (Iterator iter = map.iterator(); iter.hasNext();) { IntFloatMap.Entry entry = (IntFloatMap.Entry)iter.next(); output.writeInt(entry.key); output.writeFloat(entry.value); } }
public IntFloatMap read (Kryo kryo, Input input, Class<IntFloatMap> type) { int length = input.readVarInt(true); IntFloatMap map = new IntFloatMap(length); for (int i = 0; i < length; i++) { int key = input.readInt(); float value = input.readFloat(); map.put(key, value); } return map; }
public int getButtonAmount () { try { switch (Gdx.app.getType()) { case Android: Field androidButtons = ClassReflection .getDeclaredField(ClassReflection.forName("com.badlogic.gdx.controllers.android.AndroidController"), "buttons"); androidButtons.setAccessible(true); return ((IntIntMap)androidButtons.get(gamePad)).size; case Desktop: Field desktopButtons = ClassReflection.getDeclaredField( ClassReflection.forName("com.badlogic.gdx.controllers.lwjgl3.Lwjgl3Controller"), "buttonState"); desktopButtons.setAccessible(true); return ((boolean[])desktopButtons.get(gamePad)).length; case HeadlessDesktop: return 0; case WebGL: Field gwtButtons = ClassReflection .getDeclaredField(ClassReflection.forName("com.badlogic.gdx.controllers.gwt.GwtController"), "buttons"); gwtButtons.setAccessible(true); return ((IntFloatMap)gwtButtons.get(gamePad)).size; case iOS: return 0; default: break; } } catch (Exception ex) { ex.printStackTrace(); } return 0; }
public SoundManager(KyperBoxGame game) { this.game = game; tags = new IntFloatMap(); createTag(MASTER_VOLUME); musics = new ObjectMap<Integer,Array<Music>>(); }