equal
deleted
inserted
replaced
23 * 14.07.2012 22:51:20 |
23 * 14.07.2012 22:51:20 |
24 * |
24 * |
25 */ |
25 */ |
26 public class Game { |
26 public class Game { |
27 |
27 |
28 Mine mine = null; |
28 Mine mine = null; |
29 private Cell[][] prevStepCells; |
29 private Cell[][] prevStepCells; |
30 protected int score = 0; |
30 protected int score = 0; |
31 protected int lastScoreChange = 0; |
31 protected int lastScoreChange = 0; |
32 protected GameState state = GameState.Game; |
32 protected GameState state = GameState.Game; |
33 protected int lambdaCollectedCount = 0; |
33 protected int lambdaCollectedCount = 0; |
|
34 protected List<Movement> route = new ArrayList<Movement>(); |
34 |
35 |
35 public Game(Mine mine) { |
36 public Game(Mine mine) { |
36 this.mine = mine; |
37 this.mine = mine; |
37 } |
38 } |
38 |
39 |
65 // Score |
66 // Score |
66 int prevScore = score; |
67 int prevScore = score; |
67 score--; |
68 score--; |
68 |
69 |
69 // Moving and scoring |
70 // Moving and scoring |
|
71 route.add(mov); |
70 Coordinate nextRobotCoord = null; |
72 Coordinate nextRobotCoord = null; |
71 switch (mov) { |
73 switch (mov) { |
72 case ABORT: |
74 case ABORT: |
73 score += 25 * lambdaCollectedCount; |
75 score += 25 * lambdaCollectedCount; |
74 |
76 |
218 } |
220 } |
219 |
221 |
220 public int getLambdaCollectedCount() { |
222 public int getLambdaCollectedCount() { |
221 return lambdaCollectedCount; |
223 return lambdaCollectedCount; |
222 } |
224 } |
|
225 |
|
226 public List<Movement> getRoute() { |
|
227 return route; |
|
228 } |
|
229 |
|
230 public String getStringRoute() { |
|
231 String movs = ""; |
|
232 for (Movement mov : route) { |
|
233 movs += mov.toText(); |
|
234 } |
|
235 return movs; |
|
236 } |
223 } |
237 } |