Game #23

Merged
schrom01 merged 43 commits from Game into main 2022-03-20 16:56:34 +01:00
1 changed files with 40 additions and 0 deletions
Showing only changes of commit e94053fee8 - Show all commits

View File

@ -266,6 +266,46 @@ public class Game implements GameSpecification {
return pathList;
}
private void calculateWinner(PositionVector start, PositionVector finish, int carIndex ){
List<PositionVector> path = calculatePath(start, finish);
for (PositionVector point : path){
switch (track.getSpaceType(point)) {
case FINISH_UP:
if(start.getY() < finish.getY()) {
//track.getCar(carIndex).addWinPoint;
//TODO: add point
}
else if( start.getY() < finish.getY()) {
//TODO: deduct point
}
break;
case FINISH_DOWN:
if(start.getY() > finish.getY()){
//track.getCar(carIndex).addWinPoint;
}
else if (start.getY() < finish.getY()){
}
break;
case FINISH_RIGHT:
if(start.getX() < finish.getX()){
//track.getCar(carIndex).addWinPoint;
}
else if (start.getX() < finish.getX()){
}
break;
case FINISH_LEFT:
if(start.getX() > finish.getX()){
//track.getCar(carIndex).addWinPoint;
}
else if (start.getX() < finish.getX()){
}
}
}
}
/**