本文整理汇总了Java中com.badlogic.gdx.utils.Array.peek方法的典型用法代码示例。如果您正苦于以下问题:Java Array.peek方法的具体用法?Java Array.peek怎么用?Java Array.peek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.Array
的用法示例。
在下文中一共展示了Array.peek方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sortIkConstraint
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
private void sortIkConstraint(IkConstraint constraint) {
Bone target = constraint.target;
sortBone(target);
Array<Bone> constrained = constraint.bones;
Bone parent = constrained.first();
sortBone(parent);
if (constrained.size > 1) {
Bone child = constrained.peek();
if (!updateCache.contains(child, true)) updateCacheReset.add(child);
}
updateCache.add(constraint);
sortReset(parent.children);
constrained.peek().sorted = true;
}
示例2: peekHeader
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
private static GraphHeader peekHeader (Kryo kryo){
if (kryo.getGraphContext().containsKey(GRAPH_HEADER_KEY)) {
Array<GraphHeader> graphHeaders = (Array<GraphHeader>)kryo.getGraphContext().get(GRAPH_HEADER_KEY);
if (graphHeaders.size > 0)
return graphHeaders.peek();
}
return null;
}
示例3: Tube
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
public Tube(Array<Body> bodies) {
random = new Random();
topTubeTexture = AssetsManager.getTextureRegion(Constants.TOP_TUBE_NAME);
bottomTubeTexture = AssetsManager.getTextureRegion(Constants.BOTTOM_TUBE_NAME);
topTubeBody = bodies.first();//first item
bottomTubeBody = bodies.peek();//last item
}
示例4: Ground
import com.badlogic.gdx.utils.Array; //导入方法依赖的package包/类
public Ground(Array<Body> bodies) {
ground = bodies.first();//first item
sky = bodies.peek();//last item
textureRegionGround = AssetsManager.getTextureRegion(Constants.GROUND_IMAGE_NAME);
textureRegionSky = AssetsManager.getTextureRegion(Constants.SKY_IMAGE_NAME);
groundPositions1 = new Vector2(0, 0);
groundPositions2 = new Vector2(Constants.WIDTH, 0);
}