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


Java Array.addAll方法代码示例

本文整理汇总了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;
}
 
开发者ID:chrisj42,项目名称:miniventure,代码行数:19,代码来源:Player.java

示例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;
}
 
开发者ID:kyperbelt,项目名称:KyperBox,代码行数:21,代码来源:TiledTemplates.java

示例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);
				}
			}
		}
 
开发者ID:mingwuyun,项目名称:cocos2d-java,代码行数:33,代码来源:QuadTreeV2.java

示例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);
				}
			}
		}
 
开发者ID:mingwuyun,项目名称:cocos2d-java,代码行数:34,代码来源:QuadTree.java

示例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);
}
 
开发者ID:chrisj42,项目名称:miniventure,代码行数:13,代码来源:Entity.java

示例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;
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:9,代码来源:CustomAnimation.java

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


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