summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-05 12:54:43 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-05 12:54:43 +0200
commit289d5150711e8b89be5caedeacb779ef277301c3 (patch)
tree9e0ccb4cee46a03e89492c4331b6877651680d02 /core/src/ch/asynk/tankontank/engine
parent7ca4aa7b91179c635195ec0e3d749ced31e206be (diff)
downloadRustAndDust-289d5150711e8b89be5caedeacb779ef277301c3.zip
RustAndDust-289d5150711e8b89be5caedeacb779ef277301c3.tar.gz
Board,Map: dispose clears all paths, and sets
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index 9a0ac32..0a8a47b 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -241,7 +241,7 @@ public abstract class Board implements Disposable
debugShapes.setTransformMatrix(prevTransform);
}
- public void clearNodesVector(Vector<GridPoint2> points)
+ public void clearPointVector(Vector<GridPoint2> points)
{
for (GridPoint2 point : points)
gridPoint2Pool.free(point);
@@ -294,7 +294,7 @@ public abstract class Board implements Disposable
nodesToPoints(nodes, targets);
}
- public void clearNodesSet(Set<GridPoint2> points)
+ public void clearPointSet(Set<GridPoint2> points)
{
for (GridPoint2 point : points)
gridPoint2Pool.free(point);
@@ -331,13 +331,18 @@ public abstract class Board implements Disposable
return nodesToSet(paths, points);
}
- public int getFinalPath(Pawn pawn, Vector<Vector3> path, Orientation finalOrientation)
+ public void clearCoordinateVector(Vector<Vector3> points)
+ {
+ for (Vector3 point : points)
+ vector3Pool.free(point);
+ points.clear();
+ }
+
+ public int getCoordinatePath(Pawn pawn, Vector<Vector3> path, Orientation finalOrientation)
{
List<Vector<SearchBoard.Node>> paths = searchBoard.possiblePaths();
- for (Vector3 v : path)
- vector3Pool.free(v);
- path.clear();
+ clearCoordinateVector(path);
if (paths.size() != 1)
return 0;