本文整理汇总了Java中com.badlogic.gdx.utils.SnapshotArray.removeValue方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotArray.removeValue方法的具体用法?Java SnapshotArray.removeValue怎么用?Java SnapshotArray.removeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.SnapshotArray
的用法示例。
在下文中一共展示了SnapshotArray.removeValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doProcessEntity
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
@Override
public void doProcessEntity(Entity entity, float delta) {
TimersComponent timers = entity.getComponent(TimersComponent.class);
SnapshotArray<RuntimeTimer> timerList = timers.getBehaviors();
Object[] timerArray = timerList.begin();
for (int j = 0, n = timerList.size; j < n; j++) {
RuntimeTimer timer = (RuntimeTimer) timerArray[j];
if (!evaluateCondition(timer.getCondition()))
continue;
int count = timer.update(delta);
for (int i = 0; i < count; i++) {
addEffects(entity, timer.getEffects());
}
if (timer.isDone()) {
timerList.removeValue(timer, true);
}
}
timerList.end();
// If no timers remaining, remove the component
if (timers.getBehaviors().size == 0) {
entity.remove(TimersComponent.class);
}
}
示例2: 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);
}
示例3: cancelTouchFocus
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/** Cancels touch focus for the specified actor.
* @see #cancelTouchFocus() */
public void cancelTouchFocus (Actor actor) {
InputEvent event = Pools.obtain(InputEvent.class);
event.setStage(this);
event.setType(InputEvent.Type.touchUp);
event.setStageX(Integer.MIN_VALUE);
event.setStageY(Integer.MIN_VALUE);
// Cancel all current touch focuses for the specified listener, allowing for concurrent modification, and never cancel the
// same focus twice.
SnapshotArray<TouchFocus> touchFocuses = this.touchFocuses;
TouchFocus[] items = touchFocuses.begin();
for (int i = 0, n = touchFocuses.size; i < n; i++) {
TouchFocus focus = items[i];
if (focus.listenerActor != actor) continue;
if (!touchFocuses.removeValue(focus, true)) continue; // Touch focus already gone.
event.setTarget(focus.target);
event.setListenerActor(focus.listenerActor);
event.setPointer(focus.pointer);
event.setButton(focus.button);
focus.listener.handle(event);
// Cannot return TouchFocus to pool, as it may still be in use (eg if cancelTouchFocus is called from touchDragged).
}
touchFocuses.end();
Pools.free(event);
}
示例4: cancelTouchFocusExcept
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/** Cancels touch focus for all listeners except the specified listener.
* @see #cancelTouchFocus() */
public void cancelTouchFocusExcept (EventListener exceptListener, Actor exceptActor) {
InputEvent event = Pools.obtain(InputEvent.class);
event.setStage(this);
event.setType(InputEvent.Type.touchUp);
event.setStageX(Integer.MIN_VALUE);
event.setStageY(Integer.MIN_VALUE);
// Cancel all current touch focuses except for the specified listener, allowing for concurrent modification, and never
// cancel the same focus twice.
SnapshotArray<TouchFocus> touchFocuses = this.touchFocuses;
TouchFocus[] items = touchFocuses.begin();
for (int i = 0, n = touchFocuses.size; i < n; i++) {
TouchFocus focus = items[i];
if (focus.listener == exceptListener && focus.listenerActor == exceptActor) continue;
if (!touchFocuses.removeValue(focus, true)) continue; // Touch focus already gone.
event.setTarget(focus.target);
event.setListenerActor(focus.listenerActor);
event.setPointer(focus.pointer);
event.setButton(focus.button);
focus.listener.handle(event);
// Cannot return TouchFocus to pool, as it may still be in use (eg if cancelTouchFocus is called from touchDragged).
}
touchFocuses.end();
Pools.free(event);
}
示例5: removeEntityListener
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/**
* Removes an {@link EntityListener}
*/
public void removeEntityListener(EntityListener listener) {
listeners.removeValue(listener, true);
for (SnapshotArray<EntityListener> familyListenerArray : familyListeners.values()) {
familyListenerArray.removeValue(listener, true);
}
}
示例6: remove
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public <T> void remove(EventType<T> type, EventListener<T> listener) {
SnapshotArray<EventListener<T>> list = getList(type, false);
if (list == null)
return;
list.removeValue(listener, true);
}