# HG changeset patch # User indvdum (gotoindvdum[at]gmail[dot]com) # Date 1342303660 -14400 # Node ID 0e0f38d408c3862b6e90084f9e0356776fc92079 # Parent 7d5a3beba9c3443d9604df8782f6b032e254e914 Route history diff -r 7d5a3beba9c3 -r 0e0f38d408c3 icfp-model/src/main/java/ru/bosony/model/game/Game.java --- a/icfp-model/src/main/java/ru/bosony/model/game/Game.java Sun Jul 15 01:24:31 2012 +0400 +++ b/icfp-model/src/main/java/ru/bosony/model/game/Game.java Sun Jul 15 02:07:40 2012 +0400 @@ -25,12 +25,13 @@ */ public class Game { - Mine mine = null; - private Cell[][] prevStepCells; - protected int score = 0; - protected int lastScoreChange = 0; - protected GameState state = GameState.Game; - protected int lambdaCollectedCount = 0; + Mine mine = null; + private Cell[][] prevStepCells; + protected int score = 0; + protected int lastScoreChange = 0; + protected GameState state = GameState.Game; + protected int lambdaCollectedCount = 0; + protected List route = new ArrayList(); public Game(Mine mine) { this.mine = mine; @@ -67,6 +68,7 @@ score--; // Moving and scoring + route.add(mov); Coordinate nextRobotCoord = null; switch (mov) { case ABORT: @@ -220,4 +222,16 @@ public int getLambdaCollectedCount() { return lambdaCollectedCount; } + + public List getRoute() { + return route; + } + + public String getStringRoute() { + String movs = ""; + for (Movement mov : route) { + movs += mov.toText(); + } + return movs; + } }