@Override public void removeEmptyItems() { for (int i = 0; i < myList.myLength; i++) { GameElement e = myList.get(i); if (e.shouldBeRemoved()) myList.remove(e); } }
/** * @param c the collection to run through. Can be {@link MeshComponent#getChildren()} for example * if the child is a collection (check via instanceof!) * @param classTypeToRemove The class-type (like {@link GLAnimation}.class e.g.) If an object of * the specified class-type is found in the passed {@link Container} it will be removes */ public static void removeAllElementsOfType(Container c, Class classTypeToRemove) { EfficientList list = c.getAllItems(); for (int i = 0; i < list.myLength; i++) { if (classTypeToRemove.isAssignableFrom(list.get(i).getClass())) { c.remove(list.get(i)); } } }
@Override public boolean update(float timeDelta, Updateable parent) { for (int i = 0; i < myList.myLength; i++) { if (!myList.get(i).update(timeDelta, this)) { Log.w( LOG_TAG, "Removing " + myList.get(i) + " from list because it returned" + " false on update()"); myList.remove(myList.get(i)); } } return true; }
private void setToNextWayPoint(GeoGraph graph, GeoObj justCheckedNode) { EfficientList<GeoObj> followers = graph.getFollowingNodesOf(justCheckedNode); if (followers != null) { for (int i = 0; i < followers.myLength; i++) { GeoObj followingNode = followers.get(i); followingNode.setComp(newProxiSensor(graph)); setHighlightNodeTransformations(followingNode.getGraphicsComponent()); setHighlightEdgeTransformation(graph.getEdge(justCheckedNode, followingNode)); } } else { Log.d(LOG_TAG, justCheckedNode + " has no following nodes"); } }
/* * TODO dont call ((Command) list[i]).execute(); call .override_do() to * avoid registration in the CommandProcessorList, same for the other * methods here! */ @Override public boolean override_do() { if (myList.myLength > 0) { Log.d("Commands", "CG '" + this + "' (size=" + myList.myLength + ") NO parameter"); boolean result = true; for (int i = 0; i < myList.myLength; i++) { if (myProcessListener != null) myProcessListener.onProcessStep(i, myList.myLength, myList.get(i)); Log.d("Commands", " + CG " + this + " EXECUTING " + myList.get(i) + " (NO parameter)"); result |= myList.get(i).execute(); } return result; } return false; }
@Override public boolean override_undo() { if (myList.myLength > 0) { Log.i( "Commands", "Undoing (without parameter) Command-Group '" + this + "' (size=" + myList.myLength + ")"); boolean result = true; for (int i = myList.myLength - 1; i >= 0; i++) { if (myList.get(i) instanceof UndoableCommand) { result |= ((UndoableCommand) myList.get(i)).override_undo(); } } return result; } return false; }
@Override public boolean override_do(Object transfairObject) { if (myList.myLength > 0) { Log.d( "Commands", "CG+P '" + this + "' (size=" + myList.myLength + ") PARAM=" + transfairObject); boolean result = true; for (int i = 0; i < myList.myLength; i++) { Log.d( "Commands", " + CG+P " + this + " EXECUTING " + myList.get(i) + " (PARAM=" + transfairObject + ")"); result |= myList.get(i).execute(transfairObject); } return result; } return false; }
public void generateEditGUI(ModifierGroup s) { for (int i = 0; i < myList.myLength; i++) { myList.get(i).generateEditGUI(s); } }
@Override public boolean insert(int pos, T item) { return myList.insert(pos, item); };
@Override public boolean remove(T item) { mySearchIndex.remove(item.myName); return myList.remove(item); }
public boolean remove(String uniqueName) { GameElement itemToDelete = mySearchIndex.get(uniqueName); mySearchIndex.remove(uniqueName); return myList.remove(itemToDelete); }
@Override public boolean add(T item) { mySearchIndex.put(item.myName, item); return myList.add(item); }
@Override public void clear() { myList.clear(); mySearchIndex.clear(); }
@Override public boolean add(Command c) { return myList.add(c); }
@Override public boolean remove(Command x) { return myList.remove(x); }
@Override public void clear() { myList.clear(); }