@Override public void onGamepadDisconnected (int index) { GwtController controller = controllerMap.remove(index); if (controller != null) { synchronized (eventQueue) { GwtControllerEvent event = eventPool.obtain(); event.type = GwtControllerEvent.DISCONNECTED; event.controller = controller; eventQueue.add(event); } } }
public JsonWriter array () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(true)); return this; }
/** Clears the data being built up until now, including the vertices, indices and all parts. Must be called in between the call * to #begin and #end. Any builder calls made from the last call to #begin up until now are practically discarded. The state * (e.g. UV region, color, vertex transform) will remain unchanged. */ public void clear () { this.vertices.clear(); this.indices.clear(); this.parts.clear(); this.vindex = 0; this.lastIndex = -1; this.istart = 0; this.part = null; }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, FileHandle file) { try { return (T)readValue(type, null, new JsonReader().parse(file)); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } }
public void writeObjectStart (String name) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(); }
/** Starts writing an object, writing the actualType to a field if needed. * @param knownType May be null if the type is unknown. */ public void writeObjectStart (Class actualType, Class knownType) { try { writer.object(); } catch (IOException ex) { throw new SerializationException(ex); } if (knownType == null || knownType != actualType) writeType(actualType); }
public JsonWriter object () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(false)); return this; }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, FileHandle file) { try { return (T)readValue(type, null, new JsonReader().parse(file)); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } }
/** @param knownType May be null if the type is unknown. */ public void writeObjectStart (String name, Class actualType, Class knownType) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(actualType, knownType); }
/** @param type May be null if the type is unknown. * @param elementType May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, FileHandle file) { try { return (T)readValue(type, elementType, new JsonReader().parse(file)); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } }