feat: correction plupart des bug

- TODO: hybridCar a regler
This commit is contained in:
2025-12-18 21:00:13 +01:00
parent d210eedb5a
commit 6c75a5363f
11 changed files with 44 additions and 38 deletions

View File

@@ -1,7 +1,5 @@
package model.car;
import java.awt.Color;
/**
* HybridCar = décorateur "voiture hybride".
*
@@ -22,17 +20,22 @@ public class HybridCar extends CarDecorator {
return energy;
}
// TODO
@Override
public boolean apply() {
boolean response = car.apply();
car.move();
consumeFuel();
return true;
}
// TODO
@Override
public void consumeFuel() {
if (energy > 0) {
energy -= 10;
} else {
car.consumeFuel();
}
return response;
}
@Override