File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
lesson_16/objects/objects_app/src/main/java/com/codedifferently/lesson16/evanphilakhong Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,14 @@ public boolean isDrsAvailible() {
56
56
}
57
57
58
58
public boolean rainStrategy () {
59
- if (track .isRaining ()) {
60
- currTyre .setCurrTyre (TyreCompound .WET );
59
+ if (track .getWeather () == Weather .LIGHT_RAIN ) {
60
+ this .currTyre = TyreCompound .INTERMEDIATE ;
61
+ return true ;
62
+ } else if (track .getWeather () == Weather .HEAVY_RAIN ) {
63
+ this .currTyre = TyreCompound .WET ;
64
+ return true ;
61
65
}
66
+ return false ;
62
67
}
63
68
64
69
public static void main (String [] args ) {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class Track {
11
11
private int numLaps ;
12
12
private int trackLengthInKm ;
13
13
private boolean drsZone ;
14
- private boolean raining ;
14
+ private Weather weather ;
15
15
16
16
public static void main (String [] args ) {
17
17
You can’t perform that action at this time.
0 commit comments