}
@Override
public void onTurnEnded(TurnEndedEvent event) {
super.onTurnEnded(event);
IRobotSnapshot caveat1 = event.getTurnSnapshot().getRobots()[0];
IRobotSnapshot caveat2 = event.getTurnSnapshot().getRobots()[1];
IRobotSnapshot caveat3 = event.getTurnSnapshot().getRobots()[2];
switch (event.getTurnSnapshot().getTurn()) {
case 1:
resetStartPositions(event.getTurnSnapshot());
Assert.assertNear(1, caveat1.getVelocity());
Assert.assertNear(1, caveat2.getVelocity());
Assert.assertNear(1, caveat3.getVelocity());
Assert.assertNear(1 - 1, distance(0, caveat1));
Assert.assertNear(1 - 1, distance(1, caveat2));
Assert.assertNear(1 - 1, distance(2, caveat3));
break;
case 2:
Assert.assertNear(2, caveat1.getVelocity());
Assert.assertNear(2, caveat2.getVelocity());
Assert.assertNear(2, caveat3.getVelocity());
Assert.assertNear(3 - 1, distance(0, caveat1));
Assert.assertNear(3 - 1, distance(1, caveat2));
Assert.assertNear(3 - 1, distance(2, caveat3));
break;
case 3:
Assert.assertNear(3, caveat1.getVelocity());
Assert.assertNear(3, caveat2.getVelocity());
Assert.assertNear(3, caveat3.getVelocity());
Assert.assertNear(6 - 1, distance(0, caveat1));
Assert.assertNear(6 - 1, distance(1, caveat2));
Assert.assertNear(6 - 1, distance(2, caveat3));
break;
case 4:
Assert.assertNear(4, caveat1.getVelocity());
Assert.assertNear(4, caveat2.getVelocity());
Assert.assertNear(4, caveat3.getVelocity());
Assert.assertNear(10 - 1, distance(0, caveat1));
Assert.assertNear(10 - 1, distance(1, caveat2));
Assert.assertNear(10 - 1, distance(2, caveat3));
break;
case 5:
Assert.assertNear(5, caveat1.getVelocity());
Assert.assertNear(5, caveat2.getVelocity());
Assert.assertNear(5, caveat3.getVelocity());
Assert.assertNear(15 - 1, distance(0, caveat1));
Assert.assertNear(15 - 1, distance(1, caveat2));
Assert.assertNear(15 - 1, distance(2, caveat3));
break;
case 6:
Assert.assertNear(6, caveat1.getVelocity());
Assert.assertNear(6, caveat2.getVelocity());
Assert.assertNear(6, caveat3.getVelocity());
Assert.assertNear(21 - 1, distance(0, caveat1));
Assert.assertNear(21 - 1, distance(1, caveat2));
Assert.assertNear(21 - 1, distance(2, caveat3));
break;
case 7:
Assert.assertNear(7, caveat1.getVelocity());
Assert.assertNear(7, caveat2.getVelocity());
Assert.assertNear(7, caveat3.getVelocity());
Assert.assertNear(28 - 1, distance(0, caveat1));
Assert.assertNear(28 - 1, distance(1, caveat2));
Assert.assertNear(28 - 1, distance(2, caveat3));
break;
case 8:
Assert.assertNear(8, caveat1.getVelocity());
Assert.assertNear(8, caveat2.getVelocity());
Assert.assertNear(8, caveat3.getVelocity());
Assert.assertNear(36 - 1, distance(0, caveat1));
Assert.assertNear(36 - 1, distance(1, caveat2));
Assert.assertNear(36 - 1, distance(2, caveat3));
resetStartPositions(event.getTurnSnapshot());
break;
case 9:
Assert.assertNear(8, caveat1.getVelocity());
Assert.assertNear(8, caveat2.getVelocity());
Assert.assertNear(6, caveat3.getVelocity()); // Caveat 3 (max. speed is set to 6)
Assert.assertNear(8, distance(0, caveat1));
Assert.assertNear(8, distance(1, caveat2));
resetStartPositions(event.getTurnSnapshot());