implemented calculate winner and needed int in in car to hold winpoints.
This commit is contained in:
@@ -24,6 +24,10 @@ public class Car implements CarSpecification {
|
||||
* Current position of the car on the track grid using a {@link PositionVector}
|
||||
*/
|
||||
private PositionVector position;
|
||||
/**
|
||||
* Points that car is holding for determining winner.
|
||||
*/
|
||||
private int winPoints;
|
||||
|
||||
/**
|
||||
* Current velocity of the car using a {@link PositionVector}
|
||||
@@ -59,6 +63,18 @@ public class Car implements CarSpecification {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void increaseWinPoints() {
|
||||
winPoints ++;
|
||||
}
|
||||
|
||||
public void deductWinPoints() {
|
||||
winPoints --;
|
||||
}
|
||||
|
||||
public int getWinPoints() {
|
||||
return winPoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current velocity of the car as a PositionVector.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user