com.badlogic.gdx.utils.Array.removeAll()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(74)

本文整理了Java中com.badlogic.gdx.utils.Array.removeAll()方法的一些代码示例,展示了Array.removeAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Array.removeAll()方法的具体详情如下:
包路径:com.badlogic.gdx.utils.Array
类名称:Array
方法名:removeAll

Array.removeAll介绍

[英]Removes from this array all of elements contained in the specified array.
[中]从此数组中删除指定数组中包含的所有元素。

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
  public void freeAll (Array<T> objects) {
    obtained.removeAll(objects, true);
    super.freeAll(objects);
  }
}

代码示例来源:origin: libgdx/libgdx

@Override
  public void freeAll (Array<T> objects) {
    obtained.removeAll(objects, true);
    super.freeAll(objects);
  }
}

代码示例来源:origin: libgdx/libgdx

public boolean removeAll (Array<? extends T> array, boolean identity) {
  modified();
  return super.removeAll(array, identity);
}

代码示例来源:origin: libgdx/libgdx

public boolean removeAll (Array<? extends T> array, boolean identity) {
  modified();
  return super.removeAll(array, identity);
}

代码示例来源:origin: libgdx/libgdx

public void setLoadedTemplates(Array<T> templates){
  loadedTemplates.clear();
  loadedTemplates.addAll(templates);
  loadedTemplates.removeAll(excludedTemplates, true);
  templatesTableModel.getDataVector().removeAllElements();
  int i=0;
  for(T template : templates){
    templatesTableModel.addRow(new Object[] {getTemplateName(template, i), false});
    i++;
  }
  lastSelected = -1;
  setValue(value);
}

代码示例来源:origin: libgdx/libgdx

public void setLoadedTemplates(Array<T> templates){
  loadedTemplates.clear();
  loadedTemplates.addAll(templates);
  loadedTemplates.removeAll(excludedTemplates, true);
  templatesTableModel.getDataVector().removeAllElements();
  int i=0;
  for(T template : templates){
    templatesTableModel.addRow(new Object[] {getTemplateName(template, i), false});
    i++;
  }
  lastSelected = -1;
  setValue(value);
}

代码示例来源:origin: libgdx/libgdx

@Override
public void handle (int aEventType, Object aEventData) {
  if(aEventType == FlameMain.EVT_ASSET_RELOADED){
    Object[] data = (Object[])aEventData;
    if(data[0] instanceof ParticleEffect){
      ParticleEffect oldEffect = (ParticleEffect) data[0];
      int currentCount = value.templates.size;
      value.templates.removeAll(oldEffect.getControllers(), true);
      if(value.templates.size != currentCount){
        int diff = currentCount - value.templates.size;
        if(diff > 0){
          ParticleEffect newEffect = (ParticleEffect) data[1];
          Array<ParticleController> newControllers = newEffect.getControllers();
          if(newControllers.size > 0){
            for(int i=0, c=Math.min(diff, newControllers.size); i<c; ++i)
              value.templates.add(newControllers.get(i));
          }
        }
        else {
          value.templates.addAll( ((ParticleEffect)editor.assetManager.get(FlameMain.DEFAULT_BILLBOARD_PARTICLE)).getControllers());
        }
        
        controllerPicker.reloadTemplates();
        controllerPicker.setValue(value.templates);
        editor.restart();
      }
    }
  }
}

代码示例来源:origin: libgdx/libgdx

@Override
public void handle (int aEventType, Object aEventData) {
  if(aEventType == FlameMain.EVT_ASSET_RELOADED){
    Object[] data = (Object[])aEventData;
    if(data[0] instanceof ParticleEffect){
      ParticleEffect oldEffect = (ParticleEffect) data[0];
      int currentCount = value.templates.size;
      value.templates.removeAll(oldEffect.getControllers(), true);
      if(value.templates.size != currentCount){
        int diff = currentCount - value.templates.size;
        if(diff > 0){
          ParticleEffect newEffect = (ParticleEffect) data[1];
          Array<ParticleController> newControllers = newEffect.getControllers();
          if(newControllers.size > 0){
            for(int i=0, c=Math.min(diff, newControllers.size); i<c; ++i)
              value.templates.add(newControllers.get(i));
          }
        }
        else {
          value.templates.addAll( ((ParticleEffect)editor.assetManager.get(FlameMain.DEFAULT_BILLBOARD_PARTICLE)).getControllers());
        }
        
        controllerPicker.reloadTemplates();
        controllerPicker.setValue(value.templates);
        editor.restart();
      }
    }
  }
}

代码示例来源:origin: kotcrab/vis-ui

public boolean removeAll (Array<? extends ItemT> array, boolean identity) {
  boolean res = this.array.removeAll(array, identity);
  itemsChanged();
  return res;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

public boolean removeAll (Array<? extends T> array, boolean identity) {
  modified();
  return super.removeAll(array, identity);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

@Override
  public void freeAll (Array<T> objects) {
    obtained.removeAll(objects, true);
    super.freeAll(objects);
  }
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-tools

public void setLoadedTemplates(Array<T> templates){
  loadedTemplates.clear();
  loadedTemplates.addAll(templates);
  loadedTemplates.removeAll(excludedTemplates, true);
  templatesTableModel.getDataVector().removeAllElements();
  int i=0;
  for(T template : templates){
    templatesTableModel.addRow(new Object[] {getTemplateName(template, i), false});
    i++;
  }
  lastSelected = -1;
  setValue(value);
}

代码示例来源:origin: org.mini2Dx/mini2Dx-core

elements.removeAll(elementsWithinQuad, false);
lock.writeLock().unlock();

代码示例来源:origin: org.mini2Dx/mini2Dx-core

elements.removeAll(elementsWithinQuad, false);
lock.writeLock().unlock();

代码示例来源:origin: com.badlogicgames.gdx/gdx-tools

@Override
public void handle (int aEventType, Object aEventData) {
  if(aEventType == FlameMain.EVT_ASSET_RELOADED){
    Object[] data = (Object[])aEventData;
    if(data[0] instanceof ParticleEffect){
      ParticleEffect oldEffect = (ParticleEffect) data[0];
      int currentCount = value.templates.size;
      value.templates.removeAll(oldEffect.getControllers(), true);
      if(value.templates.size != currentCount){
        int diff = currentCount - value.templates.size;
        if(diff > 0){
          ParticleEffect newEffect = (ParticleEffect) data[1];
          Array<ParticleController> newControllers = newEffect.getControllers();
          if(newControllers.size > 0){
            for(int i=0, c=Math.min(diff, newControllers.size); i<c; ++i)
              value.templates.add(newControllers.get(i));
          }
        }
        else {
          value.templates.addAll( ((ParticleEffect)editor.assetManager.get(FlameMain.DEFAULT_BILLBOARD_PARTICLE)).getControllers());
        }
        
        controllerPicker.reloadTemplates();
        controllerPicker.setValue(value.templates);
        editor.restart();
      }
    }
  }
}

代码示例来源:origin: org.mini2Dx/mini2Dx-core

public void removeAll(Array<T> elementsToRemove) {
  if (elementsToRemove == null || elementsToRemove.size == 0) {
    return;
  }
  Array<T> elementsWithinQuad = new Array<T>();
  for (T element : elementsToRemove) {
    if (this.contains(element.getX(), element.getY())) {
      elementsWithinQuad.add(element);
    }
  }
  clearTotalElementsCache();
  if (topLeft != null) {
    for (T element : elementsWithinQuad) {
      removeElementFromChild(element);
    }
  }
  if (elements == null) {
    return;
  }
  elements.removeAll(elementsWithinQuad, false);
  for (T element : elementsWithinQuad) {
    element.removePositionChangeListener(this);
  }
  if (parent == null) {
    return;
  }
  if (parent.isMergable()) {
    parent.merge();
  }
}

相关文章