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

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

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

Array.set介绍

[英]Sets the array size, leaving any values beyond the current size null.
[中]设置数组大小,将超出当前大小的任何值保留为空。

代码示例

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

public void set (int index, T value) {
  if (iterating > 0) throw new IllegalStateException("Invalid between begin/end.");
  super.set(index, value);
}

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

public void set (int index, T value) {
  if (iterating > 0) throw new IllegalStateException("Invalid between begin/end.");
  super.set(index, value);
}

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

public void set (int index, T value) {
  modified();
  super.set(index, value);
}

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

public void set (int index, T value) {
  modified();
  super.set(index, value);
}

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

/** Register an uniform which might be used by this shader. Only possible prior to the call to init().
 * @return The ID of the uniform to use in this shader. */
public int register (final String alias, final Validator validator, final Setter setter) {
  if (locations != null) throw new GdxRuntimeException("Cannot register an uniform after initialization");
  final int existing = getUniformID(alias);
  if (existing >= 0) {
    validators.set(existing, validator);
    setters.set(existing, setter);
    return existing;
  }
  uniforms.add(alias);
  validators.add(validator);
  setters.add(setter);
  return uniforms.size - 1;
}

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

/** Register an uniform which might be used by this shader. Only possible prior to the call to init().
 * @return The ID of the uniform to use in this shader. */
public int register (final String alias, final Validator validator, final Setter setter) {
  if (locations != null) throw new GdxRuntimeException("Cannot register an uniform after initialization");
  final int existing = getUniformID(alias);
  if (existing >= 0) {
    validators.set(existing, validator);
    setters.set(existing, setter);
    return existing;
  }
  uniforms.add(alias);
  validators.add(validator);
  setters.add(setter);
  return uniforms.size - 1;
}

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

imagePaths.set(i, effectDirUri.relativize(imageUri).getPath());

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

imagePaths.set(i, effectDirUri.relativize(imageUri).getPath());

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

/** Add a attribute to this material. If the material already contains an attribute of the same type it is overwritten. */
public final void set (final Attribute attribute) {
  final int idx = indexOf(attribute.type);
  if (idx < 0) {
    enable(attribute.type);
    attributes.add(attribute);
    sorted = false;
  } else {
    attributes.set(idx, attribute);
  }
  sort(); //FIXME: See #4186
}

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

/** Add a attribute to this material. If the material already contains an attribute of the same type it is overwritten. */
public final void set (final Attribute attribute) {
  final int idx = indexOf(attribute.type);
  if (idx < 0) {
    enable(attribute.type);
    attributes.add(attribute);
    sorted = false;
  } else {
    attributes.set(idx, attribute);
  }
  sort(); //FIXME: See #4186
}

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

/** Gets the cell values that will be used as the defaults for all cells in the specified column. Columns are indexed starting
 * at 0. */
public Cell columnDefaults (int column) {
  Cell cell = columnDefaults.size > column ? columnDefaults.get(column) : null;
  if (cell == null) {
    cell = obtainCell();
    cell.clear();
    if (column >= columnDefaults.size) {
      for (int i = columnDefaults.size; i < column; i++)
        columnDefaults.add(null);
      columnDefaults.add(cell);
    } else
      columnDefaults.set(column, cell);
  }
  return cell;
}

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

/** Gets the cell values that will be used as the defaults for all cells in the specified column. Columns are indexed starting
 * at 0. */
public Cell columnDefaults (int column) {
  Cell cell = columnDefaults.size > column ? columnDefaults.get(column) : null;
  if (cell == null) {
    cell = obtainCell();
    cell.clear();
    if (column >= columnDefaults.size) {
      for (int i = columnDefaults.size; i < column; i++)
        columnDefaults.add(null);
      columnDefaults.add(cell);
    } else
      columnDefaults.set(column, cell);
  }
  return cell;
}

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

validators.set(i, null);
setters.set(i, null);

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

validators.set(i, null);
setters.set(i, null);

代码示例来源:origin: apotapov/gdx-artemis

@Override
public void added(Entity e) {
  active++;
  added++;
  entities.set(e.id, e);
}

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

public void set (int index, T value) {
  if (iterating > 0) throw new IllegalStateException("Invalid between begin/end.");
  super.set(index, value);
}

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

public void set (int index, ItemT value) {
  array.set(index, value);
  itemsChanged();
}

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

public void set (int index, T value) {
  modified();
  super.set(index, value);
}

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

/** Add a attribute to this material. If the material already contains an attribute of the same type it is overwritten. */
public final void set (final Attribute attribute) {
  final int idx = indexOf(attribute.type);
  if (idx < 0) {
    enable(attribute.type);
    attributes.add(attribute);
    sorted = false;
  } else {
    attributes.set(idx, attribute);
  }
  sort(); //FIXME: See #4186
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

@SuppressWarnings("unchecked")
  @Override
  public void changed(ChangeEvent event, Actor actor) {
    BaseActor e = ((EditModelDialog<Scene, BaseActor>) actor).getElement();
    
    // When the type is changed, a new element is created and it is needed to replace the previous element.
    if(e != list.getSelected()) {
      int i = list.getSelectedIndex();
      getItems().set(i, e);
      list.setSelectedIndex(i);
      list.invalidateHierarchy();                
    }            
  }
});

相关文章