当前位置: 首页>>代码示例>>Java>>正文


Java SnapshotArray.removeValue方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:27,代码来源:TimersSystem.java

示例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);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:21,代码来源:Actor.java

示例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);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:29,代码来源:Stage.java

示例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);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:29,代码来源:Stage.java

示例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);
    }
}
 
开发者ID:grum,项目名称:Ashley,代码行数:11,代码来源:Engine.java

示例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);
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:7,代码来源:EventDispatcher.java


注:本文中的com.badlogic.gdx.utils.SnapshotArray.removeValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。