public Entries<K, V> iterator () { return entries(); }
public Entries<K, V> iterator () { return entries(); }
@Override public String toString () { stringBuilder.setLength(0); for (final ObjectMap.Entry<String, ObjectMap<String, String>> entry : snippets.entries()) { stringBuilder.append(entry.key).append(": {"); for (final String snipname : entry.value.keys()) stringBuilder.append(snipname).append(", "); stringBuilder.append("}\n"); } return stringBuilder.toString(); } }
private static void storeImpl (ObjectMap<String, String> properties, Writer writer, String comment, boolean escapeUnicode) throws IOException { if (comment != null) { writeComment(writer, comment); } writer.write("#"); writer.write(new Date().toString()); writer.write(LINE_SEPARATOR); StringBuilder sb = new StringBuilder(200); for (Entry<String, String> entry : properties.entries()) { dumpString(sb, entry.key, true, escapeUnicode); sb.append('='); dumpString(sb, entry.value, false, escapeUnicode); writer.write(LINE_SEPARATOR); writer.write(sb.toString()); sb.setLength(0); } writer.flush(); }
@Override protected void render (ModelBatch batch, Array<ModelInstance> instances) { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) e.value.update(Gdx.graphics.getDeltaTime()); batch.render(instances, environment); }
/** @param type the asset type * @return all the assets matching the specified type */ public synchronized <T> Array<T> getAll (Class<T> type, Array<T> out) { ObjectMap<String, RefCountedContainer> assetsByType = assets.get(type); if (assetsByType != null) { for (ObjectMap.Entry<String, RefCountedContainer> asset : assetsByType.entries()) { out.add(asset.value.getObject(type)); } } return out; }
/** Removes all targets and sources. */ public void clear () { targets.clear(); for (Entry<Source, DragListener> entry : sourceListeners.entries()) entry.key.actor.removeCaptureListener(entry.value); sourceListeners.clear(); }
/** @param type the asset type * @return all the assets matching the specified type */ public synchronized <T> Array<T> getAll (Class<T> type, Array<T> out) { ObjectMap<String, RefCountedContainer> assetsByType = assets.get(type); if (assetsByType != null) { for (ObjectMap.Entry<String, RefCountedContainer> asset : assetsByType.entries()) { out.add(asset.value.getObject(type)); } } return out; }
/** Removes all targets and sources. */ public void clear () { targets.clear(); for (Entry<Source, DragListener> entry : sourceListeners.entries()) entry.key.actor.removeCaptureListener(entry.value); sourceListeners.clear(); }
protected void switchAnimation () { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) { int animIndex = 0; if (e.value.current != null) { for (int i = 0; i < e.key.animations.size; i++) { final Animation animation = e.key.animations.get(i); if (e.value.current.animation == animation) { animIndex = i; break; } } } animIndex = (animIndex + 1) % e.key.animations.size; e.value.animate(e.key.animations.get(animIndex).id, -1, 1f, null, 0.2f); } }
protected void switchAnimation () { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) { int animIndex = 0; if (e.value.current != null) { for (int i = 0; i < e.key.animations.size; i++) { final Animation animation = e.key.animations.get(i); if (e.value.current.animation == animation) { animIndex = i; break; } } } animIndex = (animIndex + 1) % (e.key.animations.size + 1); e.value.animate((animIndex == e.key.animations.size) ? null : e.key.animations.get(animIndex).id, -1, 1f, null, 0.2f); } }
protected void switchAnimation () { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) { int animIndex = 0; if (e.value.current != null) { for (int i = 0; i < e.key.animations.size; i++) { final Animation animation = e.key.animations.get(i); if (e.value.current.animation == animation) { animIndex = i; break; } } } animIndex = (animIndex + 1) % e.key.animations.size; e.value.animate(e.key.animations.get(animIndex).id, -1, 1f, null, 0.2f); } }
@Override protected void render (ModelBatch batch, Array<ModelInstance> instances) { for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) e.value.update(Gdx.graphics.getDeltaTime()); for (final ModelInstance instance : instances) renderSkeleton(instance); batch.render(instances); }
/** End applying multiple animations to the instance and update it to reflect the changes. */ protected void end () { if (!applying) throw new GdxRuntimeException("You must call begin() first"); for (Entry<Node, Transform> entry : transforms.entries()) { entry.value.toMatrix4(entry.key.localTransform); transformPool.free(entry.value); } transforms.clear(); target.calculateTransforms(); applying = false; }
/** End applying multiple animations to the instance and update it to reflect the changes. */ protected void end () { if (!applying) throw new GdxRuntimeException("You must call begin() first"); for (Entry<Node, Transform> entry : transforms.entries()) { entry.value.toMatrix4(entry.key.localTransform); transformPool.free(entry.value); } transforms.clear(); target.calculateTransforms(); applying = false; }
@Override public void read (Json json, JsonValue jsonData) { uniqueData = json.readValue("unique", ObjectMap.class, jsonData); for (Entry<String, SaveData> entry : uniqueData.entries()) { entry.value.resources = this; } data = json.readValue("data", Array.class, SaveData.class, jsonData); for (SaveData saveData : data) { saveData.resources = this; } sharedAssets.addAll(json.readValue("assets", Array.class, AssetData.class, jsonData)); resource = json.readValue("resource", null, jsonData); }
@Override public void read (Json json, JsonValue jsonData) { uniqueData = json.readValue("unique", ObjectMap.class, jsonData); for (Entry<String, SaveData> entry : uniqueData.entries()) { entry.value.resources = this; } data = json.readValue("data", Array.class, SaveData.class, jsonData); for (SaveData saveData : data) { saveData.resources = this; } sharedAssets.addAll(json.readValue("assets", Array.class, AssetData.class, jsonData)); resource = json.readValue("resource", null, jsonData); }
@Override public void render (Array<ModelInstance> instances) { dirLight.direction.rotate(dirLightRotAxis, Gdx.graphics.getDeltaTime() * 45f); super.render(null); for (ObjectMap.Entry<ModelInstance, AnimationController> e : animationControllers.entries()) e.value.update(Gdx.graphics.getDeltaTime()); shaderBatch.begin(cam); shaderBatch.render(instances, environment); shaderBatch.end(); }
protected void loadNodes (Iterable<ModelNode> modelNodes) { nodePartBones.clear(); for (ModelNode node : modelNodes) { nodes.add(loadNode(node)); } for (ObjectMap.Entry<NodePart, ArrayMap<String, Matrix4>> e : nodePartBones.entries()) { if (e.key.invBoneBindTransforms == null) e.key.invBoneBindTransforms = new ArrayMap<Node, Matrix4>(Node.class, Matrix4.class); e.key.invBoneBindTransforms.clear(); for (ObjectMap.Entry<String, Matrix4> b : e.value.entries()) e.key.invBoneBindTransforms.put(getNode(b.key), new Matrix4(b.value).inv()); } }
protected void loadNodes (Iterable<ModelNode> modelNodes) { nodePartBones.clear(); for (ModelNode node : modelNodes) { nodes.add(loadNode(node)); } for (ObjectMap.Entry<NodePart, ArrayMap<String, Matrix4>> e : nodePartBones.entries()) { if (e.key.invBoneBindTransforms == null) e.key.invBoneBindTransforms = new ArrayMap<Node, Matrix4>(Node.class, Matrix4.class); e.key.invBoneBindTransforms.clear(); for (ObjectMap.Entry<String, Matrix4> b : e.value.entries()) e.key.invBoneBindTransforms.put(getNode(b.key), new Matrix4(b.value).inv()); } }