本文整理汇总了Java中com.badlogic.gdx.utils.SnapshotArray.removeIndex方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotArray.removeIndex方法的具体用法?Java SnapshotArray.removeIndex怎么用?Java SnapshotArray.removeIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.SnapshotArray
的用法示例。
在下文中一共展示了SnapshotArray.removeIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cancelTouchFocus
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void cancelTouchFocus(EventListener paramEventListener, Actor paramActor)
{
InputEvent localInputEvent = (InputEvent)Pools.obtain(InputEvent.class);
localInputEvent.setStage(this);
localInputEvent.setType(InputEvent.Type.touchUp);
localInputEvent.setStageX(-2.147484E+09F);
localInputEvent.setStageY(-2.147484E+09F);
SnapshotArray localSnapshotArray = this.touchFocuses;
for (int i = -1 + localSnapshotArray.size; i >= 0; i--)
{
Stage.TouchFocus localTouchFocus = (Stage.TouchFocus)localSnapshotArray.get(i);
if ((localTouchFocus.listener != paramEventListener) || (localTouchFocus.listenerActor != paramActor))
{
localInputEvent.setTarget(localTouchFocus.target);
localInputEvent.setListenerActor(localTouchFocus.listenerActor);
localInputEvent.setPointer(localTouchFocus.pointer);
localInputEvent.setButton(localTouchFocus.button);
localSnapshotArray.removeIndex(i);
localTouchFocus.listener.handle(localInputEvent);
}
}
Pools.free(localInputEvent);
}
示例2: removeAllInventoryItemsWithName
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void removeAllInventoryItemsWithName(String name){
if( hasItem() ){
SnapshotArray<Actor> arrayChildren = this.getChildren();
//skip first two elements
for(int i = arrayChildren.size - 1; i > 1 ; i--) {
String itemName = arrayChildren.get(i).getName();
if( itemName.equalsIgnoreCase(name)){
decrementItemCount(true);
arrayChildren.removeIndex(i);
}
}
}
}
示例3: removeTouchFocus
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/** Removes the listener from being notified for all touchDragged and touchUp events for the specified pointer and button. Note
* the listener may never receive a touchUp event if this method is used. */
public void removeTouchFocus (EventListener listener, Actor listenerActor, Actor target, int pointer, int button) {
SnapshotArray<TouchFocus> touchFocuses = this.touchFocuses;
for (int i = touchFocuses.size - 1; i >= 0; i--) {
TouchFocus focus = touchFocuses.get(i);
if (focus.listener == listener && focus.listenerActor == listenerActor && focus.target == target
&& focus.pointer == pointer && focus.button == button) {
touchFocuses.removeIndex(i);
Pools.free(focus);
}
}
}
示例4: removeTouchFocus
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void removeTouchFocus(EventListener paramEventListener, Actor paramActor1, Actor paramActor2, int paramInt1, int paramInt2)
{
SnapshotArray localSnapshotArray = this.touchFocuses;
for (int i = -1 + localSnapshotArray.size; i >= 0; i--)
{
Stage.TouchFocus localTouchFocus = (Stage.TouchFocus)localSnapshotArray.get(i);
if ((localTouchFocus.listener == paramEventListener) && (localTouchFocus.listenerActor == paramActor1) && (localTouchFocus.target == paramActor2) && (localTouchFocus.pointer == paramInt1) && (localTouchFocus.button == paramInt2))
{
localSnapshotArray.removeIndex(i);
Pools.free(localTouchFocus);
}
}
}
示例5: touchUp
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public boolean touchUp(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
int i = 0;
if (this.touchFocuses.size == 0)
return false;
screenToStageCoordinates(this.stageCoords.set(paramInt1, paramInt2));
InputEvent localInputEvent = (InputEvent)Pools.obtain(InputEvent.class);
localInputEvent.setType(InputEvent.Type.touchUp);
localInputEvent.setStage(this);
localInputEvent.setStageX(this.stageCoords.x);
localInputEvent.setStageY(this.stageCoords.y);
localInputEvent.setPointer(paramInt3);
localInputEvent.setButton(paramInt4);
SnapshotArray localSnapshotArray = this.touchFocuses;
Stage.TouchFocus[] arrayOfTouchFocus = (Stage.TouchFocus[])localSnapshotArray.begin();
int j = localSnapshotArray.size;
while (i < j)
{
Stage.TouchFocus localTouchFocus2 = arrayOfTouchFocus[i];
if ((localTouchFocus2.pointer == paramInt3) && (localTouchFocus2.button == paramInt4))
{
localInputEvent.setTarget(localTouchFocus2.target);
localInputEvent.setListenerActor(localTouchFocus2.listenerActor);
if (localTouchFocus2.listener.handle(localInputEvent))
localInputEvent.handle();
}
i++;
}
localSnapshotArray.end();
for (int k = -1 + localSnapshotArray.size; k >= 0; k--)
{
Stage.TouchFocus localTouchFocus1 = (Stage.TouchFocus)localSnapshotArray.get(k);
if ((localTouchFocus1.pointer == paramInt3) && (localTouchFocus1.button == paramInt4))
{
localSnapshotArray.removeIndex(k);
Pools.free(localTouchFocus1);
}
}
boolean bool = localInputEvent.isHandled();
Pools.free(localInputEvent);
return bool;
}