Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
09ab684fdd
|
@ -62,14 +62,25 @@ public class Car implements CarSpecification {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increases the winpoints by one
|
||||||
|
*/
|
||||||
public void increaseWinPoints() {
|
public void increaseWinPoints() {
|
||||||
winPoints++;
|
winPoints++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decreases the winpoints by one
|
||||||
|
*/
|
||||||
public void deductWinPoints() {
|
public void deductWinPoints() {
|
||||||
winPoints--;
|
winPoints--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current value of winpoints.
|
||||||
|
*
|
||||||
|
* @return winpoints of the car
|
||||||
|
*/
|
||||||
public int getWinPoints() {
|
public int getWinPoints() {
|
||||||
return winPoints;
|
return winPoints;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +151,7 @@ public class Car implements CarSpecification {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark this Car as being crashed.
|
* Marks the car as crashed
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void crash() {
|
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.
|
* @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
|
* @param moveStrategy Strategy to be implemented
|
||||||
*/
|
*/
|
||||||
public void setMoveStrategy(MoveStrategy moveStrategy) {
|
public void setMoveStrategy(MoveStrategy moveStrategy) {
|
||||||
this.moveStrategy = moveStrategy;
|
this.moveStrategy = moveStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get current move strategy
|
|
||||||
*
|
|
||||||
* @return MoveStrategy
|
|
||||||
*/
|
|
||||||
public MoveStrategy getMoveStrategy() {
|
|
||||||
return this.moveStrategy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue