finished Java

This commit is contained in:
Leonardo Brandenberger 2022-03-25 09:27:00 +01:00
parent 2366f798ca
commit 38728f0921
1 changed files with 23 additions and 12 deletions

View File

@ -62,14 +62,25 @@ public class Car implements CarSpecification {
return id;
}
/**
* Increases the winpoints by one
*/
public void increaseWinPoints() {
winPoints++;
}
/**
* Decreases the winpoints by one
*/
public void deductWinPoints() {
winPoints--;
}
/**
* Returns the current value of winpoints.
*
* @return winpoints of the car
*/
public int getWinPoints() {
return winPoints;
}
@ -140,7 +151,7 @@ public class Car implements CarSpecification {
}
/**
* Mark this Car as being crashed.
* Marks the car as crashed
*/
@Override
public void crash() {
@ -148,7 +159,7 @@ public class Car implements CarSpecification {
}
/**
* Returns whether this Car has been marked as crashed.
* Returns whether this Car has been marked as crashed or not
*
* @return Returns true if crash() has been called on this Car, false otherwise.
*/
@ -158,20 +169,20 @@ public class Car implements CarSpecification {
}
/**
* Set move strategy
* Returns the current move Strategy
*
* @return the current move Strategy
*/
public MoveStrategy getMoveStrategy() {
return this.moveStrategy;
}
/**
* Set the move Strategy of the car.
*
* @param moveStrategy Strategy to be implemented
*/
public void setMoveStrategy(MoveStrategy moveStrategy) {
this.moveStrategy = moveStrategy;
}
/**
* Get current move strategy
*
* @return MoveStrategy
*/
public MoveStrategy getMoveStrategy() {
return this.moveStrategy;
}
}