From 38728f092144e15dea77f0134b3fe88acdb2c42b Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Fri, 25 Mar 2022 09:27:00 +0100 Subject: [PATCH] finished Java --- src/main/java/ch/zhaw/pm2/racetrack/Car.java | 35 +++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/main/java/ch/zhaw/pm2/racetrack/Car.java b/src/main/java/ch/zhaw/pm2/racetrack/Car.java index da73693..70206ac 100644 --- a/src/main/java/ch/zhaw/pm2/racetrack/Car.java +++ b/src/main/java/ch/zhaw/pm2/racetrack/Car.java @@ -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; - } }