本文整理汇总了Java中com.badlogic.gdx.utils.Array.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java Array.addAll方法的具体用法?Java Array.addAll怎么用?Java Array.addAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.Array
的用法示例。
在下文中一共展示了Array.addAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInteractionQueue
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
@NotNull
private Array<WorldObject> getInteractionQueue() {
Array<WorldObject> objects = new Array<>();
// get level, and don't interact if level is not found
Level level = Level.getEntityLevel(this);
if(level == null) return objects;
Rectangle interactionBounds = getInteractionRect();
objects.addAll(level.getOverlappingEntities(interactionBounds, this));
Tile tile = level.getClosestTile(interactionBounds);
if(tile != null)
objects.add(tile);
return objects;
}
示例2: getProperties
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
public Array<TypeProperty> getProperties(){
Array<TypeProperty> ret_properties = new Array<TiledObjectTypes.TypeProperty>();
ret_properties.addAll(template_type.getProperties());
if(parent_type!=null) {
Array<TypeProperty> parent_properties = parent_type.getProperties();
for(int i = 0;i < parent_properties.size;i++) {
boolean added = false;
for(int l = 0;l < ret_properties.size;l++) {
if(parent_properties.get(i).getName().equals(ret_properties.get(l).getName())) {
added = true;
break;
}
}
if(!added)
ret_properties.add(parent_properties.get(i));
}
}
return ret_properties;
}
示例3: query
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
public void query(Rectangle rect, Array<IQuadTreeObject> ret) {
if(type == -1) {
// this is root node
ret.addAll(objs);
}
if(!rect.overlaps(_rect)) { //������ýڵ㲻�ཻ��ֱ���˳�
return;
}
// System.out.println("query node : success -------------------");
//�ڵ�ռ�Ҳ��Ŷ���ͨ���ཻ������ȫ�����
for(int i = objs.size - 1; i >= 0; --i) {
ret.add(objs.get(i));
}
// ret.addAll(objs);
if(sides != null) {
//�����߿ռ�
for(int i = 0; i < sides.length; ++i) {
//��Ҫ�߶��Լ�ȥ�ж��Ƿ���������
sides[i].query(rect, ret);
}
}
if(children != null) {
for(int i = 0; i < children.length; ++i) {
children[i].query(rect, ret);
}
}
}
示例4: query
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
public void query(Rectangle rect, Array<IQuadTreeObject> ret) {
if(type == -1) {
// this is root node
ret.addAll(objs);
}
if(!rect.overlaps(_rect)) { //������ýڵ㲻�ཻ��ֱ���˳�
return;
}
// System.out.println("query node : success -------------------");
if(this.children == null || sides == null) {
//û���ӽڵ� ������ж�����˳�
ret.addAll(objs);
return;
}
if(sides != null) {
//�����߿ռ�
for(int i = 0; i < sides.length; ++i) {
//��Ҫ�߶��Լ�ȥ�ж��Ƿ���������
sides[i].query(rect, ret);
}
}
if(children != null) {
for(int i = 0; i < children.length; ++i) {
children[i].query(rect, ret);
}
}
}
示例5: update
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
@Override
public void update(float delta) {
Level level = getLevel();
if(level == null) return;
Array<WorldObject> objects = new Array<>();
objects.addAll(level.getOverlappingEntities(getBounds(), this));
Tile tile = level.getClosestTile(getBounds());
if(tile != null) objects.add(tile);
for(WorldObject obj: objects)
obj.touching(this);
}
示例6: convertToOneDimensionArray
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
private static <T> Array<T> convertToOneDimensionArray(T[][] frames)
{
int size = frames.length * frames[0].length;
Array<T> newArray = new Array<>(true, size);
for(T[] framesTable : frames)
newArray.addAll(framesTable);
return newArray;
}
示例7: dispatchTouchEvent
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
/** Touch event needs to be processed different with other events since it needs support ALL_AT_ONCE and ONE_BY_NONE mode. */
public void dispatchTouchEvent(EventTouch event) {
sortEventListeners(EventListenerTouchOneByOne.LISTENER_ID);
sortEventListeners(EventListenerTouchAllAtOnce.LISTENER_ID);
EventListenerVector oneByOneListeners = getListeners(EventListenerTouchOneByOne.LISTENER_ID);
EventListenerVector allAtOnceListeners = getListeners(EventListenerTouchAllAtOnce.LISTENER_ID);
// If there aren't any touch listeners, return directly.
if (null == oneByOneListeners && null == allAtOnceListeners) {return;}
boolean isNeedsMutableSet = (oneByOneListeners != null && allAtOnceListeners != null);
final Array<Touch> originalTouches = event.getTouches();
//TODO stack
_poolTouchArray.clear();
Array<Touch> mutableTouches = _poolTouchArray;
mutableTouches.clear();
mutableTouches.addAll(originalTouches);
//
// process the target handlers 1st
//
if (oneByOneListeners != null) {
int mutableTouchesIter = 0;
int touchesIter = 0;
for (; touchesIter < originalTouches.size; ++touchesIter)
{
boolean isSwallowed = false;
Touch currTouch = originalTouches.get(touchesIter);
//
onTouchEvent.init(event, currTouch, isNeedsMutableSet, isSwallowed,
mutableTouches, mutableTouchesIter);
dispatchTouchEventToListeners(oneByOneListeners, onTouchEvent);
isSwallowed = onTouchEvent.isSwallowed;
mutableTouchesIter = onTouchEvent.mutableTouchesIter;
if (event.isStopped()) {return;}
if (!isSwallowed) {++mutableTouchesIter;}
}
}
//
// process standard handlers 2nd
//
if (allAtOnceListeners != null && mutableTouches.size > 0) {
onTouchesEvent.init(event, mutableTouches);
dispatchTouchEventToListeners(allAtOnceListeners, onTouchesEvent);
if (event.isStopped()) {return;}
}
updateListeners(event);
}