本文整理匯總了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);
}