本文整理汇总了Java中com.badlogic.gdx.utils.SnapshotArray.add方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotArray.add方法的具体用法?Java SnapshotArray.add怎么用?Java SnapshotArray.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.SnapshotArray
的用法示例。
在下文中一共展示了SnapshotArray.add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setZIndex
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void setZIndex(int paramInt)
{
if (paramInt < 0)
throw new IllegalArgumentException("ZIndex cannot be < 0.");
Group localGroup = getParent();
if (localGroup == null);
SnapshotArray localSnapshotArray;
do
{
return;
localSnapshotArray = localGroup.getChildren();
}
while ((localSnapshotArray.size == 1) || (!localSnapshotArray.removeValue(this, true)));
if (paramInt >= localSnapshotArray.size)
{
localSnapshotArray.add(this);
return;
}
localSnapshotArray.insert(paramInt, this);
}
示例2: newSnapshotArray
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/** @param values will be appended to the array.
* @return a new SnapshotArray with the passed values.
* @param <Type> type of stored elements. */
public static <Type> SnapshotArray<Type> newSnapshotArray(final Iterable<? extends Type> values) {
final SnapshotArray<Type> array = new SnapshotArray<Type>();
for (final Type value : values) {
array.add(value);
}
return array;
}
示例3: addEntityListener
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/**
* Adds an {@link EntityListener} for a specific {@link Family}.
* <p/>
* The listener will be notified every time an entity is added/removed to/from the given family.
*/
public void addEntityListener(Family family, EntityListener listener) {
registerFamily(family);
SnapshotArray<EntityListener> listeners = familyListeners.get(family);
if (listeners == null) {
listeners = new SnapshotArray<EntityListener>(false, 16);
familyListeners.put(family, listeners);
}
listeners.add(listener);
}
示例4: add
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public <T> void add(EventType<T> type, EventListener<T> listener) {
SnapshotArray<EventListener<T>> list = getList(type, true);
list.add(listener);
}