Java Code Examples for com.badlogic.gdx.utils.IntArray#add()
The following examples show how to use
com.badlogic.gdx.utils.IntArray#add() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: G3dtLoader.java From uracer-kotd with Apache License 2.0 | 6 votes |
private static IntArray readFaces (BufferedReader in) throws NumberFormatException, IOException { int numFaces = readInt(in); IntArray faceIndices = new IntArray(); IntArray triangles = new IntArray(); IntArray indices = new IntArray(); for (int face = 0; face < numFaces; face++) { readIntArray(in, faceIndices); int numIndices = faceIndices.get(0); triangles.clear(); int baseIndex = faceIndices.get(1); for (int i = 2; i < numIndices; i++) { triangles.add(baseIndex); triangles.add(faceIndices.items[i]); triangles.add(faceIndices.items[i + 1]); } indices.addAll(triangles); } indices.shrink(); return indices; }
Example 2
Source File: PatternModifier.java From beatoraja with GNU General Public License v3.0 | 6 votes |
/** * 変更対象のレーン番号が格納された配列を返す * @param mode * プレイモード * @param containsScratch * スクラッチレーンを含むか * @return レーン番号の配列 */ protected int[] getKeys(Mode mode, boolean containsScratch) { int key = (modifyTargetSide == SIDE_2P) ? mode.key / mode.player : 0; if (key == mode.key) { return new int[0]; } else { IntArray keys = new IntArray(); for (int i = 0; i < mode.key / mode.player; i++) { if (containsScratch || !mode.isScratchKey(key + i)) { keys.add(key + i); } } return keys.toArray(); } }
Example 3
Source File: G3dtLoader.java From uracer-kotd with Apache License 2.0 | 5 votes |
private static void readIntArray (BufferedReader in, IntArray array) throws IOException { String[] tokens = read(in).split(","); int len = tokens.length; array.clear(); for (int i = 0; i < len; i++) { array.add(Integer.parseInt(tokens[i].trim())); } }
Example 4
Source File: JamepadControllerMonitor.java From gdx-controllerutils with Apache License 2.0 | 5 votes |
private void update() { IntArray disconnectedControllers = new IntArray(indexToController.size); for (Tuple tuple : indexToController.values()) { JamepadController controller = tuple.controller; boolean connected = controller.update(); if (!connected) { disconnectedControllers.add(tuple.index.getIndex()); } } for (int i = 0; i < disconnectedControllers.size; i++) { indexToController.remove(disconnectedControllers.get(i)); } }
Example 5
Source File: LR2SkinCSVLoader.java From beatoraja with GNU General Public License v3.0 | 5 votes |
protected int[] readOffset(String[] str, int startIndex, int[] offset) { IntArray result = new IntArray(); for(int i : offset) { result.add(i); } for (int i = startIndex; i < str.length; i++) { String s = str[i].replaceAll("[^0-9-]", ""); if(s.length() > 0) { result.add(Integer.parseInt(s)); } } return result.toArray(); }
Example 6
Source File: Die.java From dice-heroes with GNU General Public License v3.0 | 5 votes |
public IntArray getAvailableIndices(Ability ability) { int availableSkill = getTotalSkill() - getUsedSkill(); IntArray res = new IntArray(); for (int i = 0; i < abilities.size; i++) { Ability check = abilities.get(i); if (check == ability) continue; boolean canBePlaced = check == null ? availableSkill >= ability.skill : availableSkill >= ability.skill - check.skill; if (canBePlaced) { res.add(i); } } return res; }
Example 7
Source File: DieNet.java From dice-heroes with GNU General Public License v3.0 | 5 votes |
private void highlightMove(Ability ability) { IntArray available = new IntArray(); for (int i = 0; i < die.abilities.size; i++) { if (die.abilities.get(i) != ability) available.add(i); } highlight(available); }
Example 8
Source File: ItemData.java From riiablo with Apache License 2.0 | 5 votes |
public IntArray getLocation(Location location, StoreLoc storeLoc) { Item[] items = itemData.items; IntArray copy = new IntArray(items.length); for (int i = 0, s = itemData.size; i < s; i++) { Item item = items[i]; if (item.location != location) continue; if (location == Location.STORED && item.storeLoc != storeLoc) continue; copy.add(i); } return copy; }
Example 9
Source File: TXT.java From riiablo with Apache License 2.0 | 4 votes |
public IntArray getColumnId(String[] text, IntArray dst) { dst.clear(); for (int i = 0; i < text.length; i++) dst.add(getColumnId(text[i])); return dst; }
Example 10
Source File: BehaviorTreeViewer.java From gdx-ai with Apache License 2.0 | 4 votes |
private void fill (IntArray taskSteps, TaskNode taskNode) { taskSteps.add(taskNode.step); for (Node child : taskNode.getChildren()) { fill(taskSteps, (TaskNode)child); } }