Ejemplo n.º 1
0
 @Override
 public void removeEmptyItems() {
   for (int i = 0; i < myList.myLength; i++) {
     GameElement e = myList.get(i);
     if (e.shouldBeRemoved()) myList.remove(e);
   }
 }
Ejemplo n.º 2
0
 /**
  * @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));
     }
   }
 }
Ejemplo n.º 3
0
 @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");
    }
  }
Ejemplo n.º 5
0
 /*
  * 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;
 }
Ejemplo n.º 6
0
 @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;
 }
Ejemplo n.º 7
0
 @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;
 }
Ejemplo n.º 8
0
 public void generateEditGUI(ModifierGroup s) {
   for (int i = 0; i < myList.myLength; i++) {
     myList.get(i).generateEditGUI(s);
   }
 }
Ejemplo n.º 9
0
 @Override
 public boolean insert(int pos, T item) {
   return myList.insert(pos, item);
 };
Ejemplo n.º 10
0
 @Override
 public boolean remove(T item) {
   mySearchIndex.remove(item.myName);
   return myList.remove(item);
 }
Ejemplo n.º 11
0
 public boolean remove(String uniqueName) {
   GameElement itemToDelete = mySearchIndex.get(uniqueName);
   mySearchIndex.remove(uniqueName);
   return myList.remove(itemToDelete);
 }
Ejemplo n.º 12
0
 @Override
 public boolean add(T item) {
   mySearchIndex.put(item.myName, item);
   return myList.add(item);
 }
Ejemplo n.º 13
0
 @Override
 public void clear() {
   myList.clear();
   mySearchIndex.clear();
 }
Ejemplo n.º 14
0
 @Override
 public boolean add(Command c) {
   return myList.add(c);
 }
Ejemplo n.º 15
0
 @Override
 public boolean remove(Command x) {
   return myList.remove(x);
 }
Ejemplo n.º 16
0
 @Override
 public void clear() {
   myList.clear();
 }