synchronized void injectDependencies (String parentAssetFilename, Array<AssetDescriptor> dependendAssetDescs) { ObjectSet<String> injected = this.injected; for (AssetDescriptor desc : dependendAssetDescs) { if (injected.contains(desc.fileName)) continue; // Ignore subsequent dependencies if there are duplicates. injected.add(desc.fileName); injectDependency(parentAssetFilename, desc); } injected.clear(); }
public T removeIndex (int index) { T key = items.removeIndex(index); super.remove(key); return key; }
/** Clears the set and reduces the size of the backing arrays to be the specified capacity, if they are larger. The reduction * is done by allocating new arrays, though for large arrays this can be faster than clearing the existing array. */ public void clear (int maximumCapacity) { if (capacity <= maximumCapacity) { clear(); return; } size = 0; resize(maximumCapacity); }
public void addAll (ObjectSet<T> set) { ensureCapacity(set.size); for (T key : set) add(key); }
/** Releases all resources associated with this TextureAtlas instance. This releases all the textures backing all TextureRegions * and Sprites, which should no longer be used after calling dispose. */ public void dispose () { for (Texture texture : textures) texture.dispose(); textures.clear(); }
public boolean add (T key) { if (!super.add(key)) return false; items.add(key); return true; }
public boolean equals (Object obj) { if (!(obj instanceof ObjectSet)) return false; ObjectSet other = (ObjectSet)obj; if (other.size != size) return false; T[] keyTable = this.keyTable; for (int i = 0, n = capacity + stashSize; i < n; i++) if (keyTable[i] != null && !other.contains(keyTable[i])) return false; return true; }
/** Creates a {@code PriorityQueue} with the specified initial capacity that orders its elements according to their * {@linkplain Comparable natural ordering}. * * @param initialCapacity the initial capacity for this priority queue */ public PriorityQueue (int initialCapacity) { this.queue = new Object[initialCapacity]; this.set = new ObjectSet<E>(initialCapacity); }
/** @return The index of the first selected item. The top item has an index of 0. Nothing selected has an index of -1. */ public int getSelectedIndex () { ObjectSet<T> selected = selection.items(); return selected.size == 0 ? -1 : items.indexOf(selected.first(), false); }
renderer = new ShapeRenderer(); skin = new Skin(Gdx.files.internal("data/uiskin.json")); skin.getAtlas().getTextures().iterator().next().setFilter(TextureFilter.Nearest, TextureFilter.Nearest); skin.getFont("default-font").getData().markupEnabled = true; skin.getFont("default-font").getData().setScale(scale);
/** Releases all resources associated with this TextureAtlas instance. This releases all the textures backing all TextureRegions * and Sprites, which should no longer be used after calling dispose. */ public void dispose () { for (Texture texture : textures) texture.dispose(); textures.clear(); }
public boolean add (T key) { if (!super.add(key)) return false; items.add(key); return true; }
public boolean add(ImageEntry image) { if (!image.fileHandle.exists()) { System.out.println(String.format( "WARNING: Input file doesn't exist: \"%s\"", image.fileHandle.path())); return false; } if (imageSet.contains(image)) { imageSet.remove(image); System.out.println(String.format( "WARNING: Region: \"%s\" is listed twice. The last added configuration will be used - \"%s\"", image.regionName, image.fileHandle.path())); } return imageSet.add(image); }
public boolean equals (Object obj) { if (!(obj instanceof ObjectSet)) return false; ObjectSet other = (ObjectSet)obj; if (other.size != size) return false; T[] keyTable = this.keyTable; for (int i = 0, n = capacity + stashSize; i < n; i++) if (keyTable[i] != null && !other.contains(keyTable[i])) return false; return true; }
public void addAll (T[] array, int offset, int length) { ensureCapacity(length); for (int i = offset, n = i + length; i < n; i++) add(array[i]); }
/** Creates a {@code PriorityQueue} with the specified initial capacity that orders its elements according to their * {@linkplain Comparable natural ordering}. * * @param initialCapacity the initial capacity for this priority queue */ public PriorityQueue (int initialCapacity) { this.queue = new Object[initialCapacity]; this.set = new ObjectSet<E>(initialCapacity); }
/** @return The index of the first selected item. The top item has an index of 0. Nothing selected has an index of -1. */ public int getSelectedIndex () { ObjectSet<T> selected = selection.items(); return selected.size == 0 ? -1 : items.indexOf(selected.first(), false); }