diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-09 00:20:30 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-09 00:20:30 +0200 |
commit | ace2a9c5f7c62f12088655577e89d348278a9a2d (patch) | |
tree | f998e341ea26547646954ce466af64fffde8e9ed /core | |
parent | 3d5fc509f7e524abc3b606ff1d579e9ad747c711 (diff) | |
download | RustAndDust-ace2a9c5f7c62f12088655577e89d348278a9a2d.zip RustAndDust-ace2a9c5f7c62f12088655577e89d348278a9a2d.tar.gz |
SearchBoard: clean up
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 6f22f74..77ffe4c 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -40,14 +40,14 @@ public class SearchBoard private LinkedList<Node> queue; private ArrayDeque<Node> roadMarch; - private ArrayList<Node> path = new ArrayList<Node>(20); - private List<ArrayList<Node>> possiblePaths = new LinkedList<ArrayList<Node>>(); - private List<Node> possiblePathsFilters = new ArrayList<Node>(5); - private List<Node> moves; private List<Node> targets; private List<Node> los; + private List<Node> path; + private List<ArrayList<Node>> possiblePaths; + private List<Node> possiblePathsFilters; + public SearchBoard(Board board, int cols, int rows) { this.cols = cols; @@ -77,6 +77,10 @@ public class SearchBoard this.moves = new ArrayList<Node>(40); this.targets = new ArrayList<Node>(10); this.los = new ArrayList<Node>(10); + + this.path = new ArrayList<Node>(20); + this.possiblePaths = new LinkedList<ArrayList<Node>>(); + this.possiblePathsFilters = new ArrayList<Node>(5); } private boolean inMap(int col, int row) @@ -502,7 +506,7 @@ public class SearchBoard public void clearPossiblePaths() { path.clear(); - for (ArrayList<Node> v : possiblePaths) + for (List<Node> v : possiblePaths) v.clear(); possiblePaths.clear(); possiblePathsFilters.clear(); |