From ace2a9c5f7c62f12088655577e89d348278a9a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 9 Oct 2014 00:20:30 +0200 Subject: SearchBoard: clean up --- core/src/ch/asynk/tankontank/engine/SearchBoard.java | 14 +++++++++----- 1 file 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 queue; private ArrayDeque roadMarch; - private ArrayList path = new ArrayList(20); - private List> possiblePaths = new LinkedList>(); - private List possiblePathsFilters = new ArrayList(5); - private List moves; private List targets; private List los; + private List path; + private List> possiblePaths; + private List possiblePathsFilters; + public SearchBoard(Board board, int cols, int rows) { this.cols = cols; @@ -77,6 +77,10 @@ public class SearchBoard this.moves = new ArrayList(40); this.targets = new ArrayList(10); this.los = new ArrayList(10); + + this.path = new ArrayList(20); + this.possiblePaths = new LinkedList>(); + this.possiblePathsFilters = new ArrayList(5); } private boolean inMap(int col, int row) @@ -502,7 +506,7 @@ public class SearchBoard public void clearPossiblePaths() { path.clear(); - for (ArrayList v : possiblePaths) + for (List v : possiblePaths) v.clear(); possiblePaths.clear(); possiblePathsFilters.clear(); -- cgit v1.1-2-g2b99