]> Git Server - tankstelle.git/commitdiff
Removed constructor overloads because according to project specifications the number...
authorRobin Cheney <cheneyr@eternal.ddnss.de>
Sun, 16 Nov 2025 08:56:31 +0000 (09:56 +0100)
committerRobin Cheney <cheneyr@eternal.ddnss.de>
Sun, 16 Nov 2025 08:56:31 +0000 (09:56 +0100)
src/main/java/de/diejungsvondertanke/tankstelle/LargeFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/MediumFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/SmallFuelStation.java

index 7d19b2ce2d87e8504a2d226453227b186859bdd7..05aba133e011978d7abb7e5b657b136266298100 100644 (file)
@@ -4,6 +4,10 @@ package de.diejungsvondertanke.tankstelle;
  * Large {@link FuelStation fuel station}
  */
 public class LargeFuelStation extends FuelStation {
+    /**
+     * Number of employees
+     */
+    public static final byte NUMBER_OF_EMPLOYEES = 4;
     /**
      * The company managing the integrated supermarket
      */
@@ -16,24 +20,7 @@ public class LargeFuelStation extends FuelStation {
      * @see #supermarket_company
      */
     public LargeFuelStation(String supermarket_company) {
-        super((byte) 4, Size.LARGE, new Fuel[] { new Fuel(FuelType.SUPER, 8000f, 1.7f, 16000),
-                new Fuel(FuelType.SUPER_E10, 8000f, 1.7f, 16000),
-                new Fuel(FuelType.DIESEL, 8000f, 1.7f, 16000),
-                new Fuel(FuelType.PREMIUM_DIESEL, 8000f, 1.7f, 16000),
-                new Fuel(FuelType.AUTOGAS, 8000f, 1.7f, 16000) });
-        this.supermarket_company = supermarket_company;
-    }
-
-    /**
-     * Constructs large {@link FuelStation fuel station}s
-     * 
-     * @param supermarket_company The company managing the integrated supermarket
-     * @param number_of_employees Number of employees
-     * @see #supermarket_company
-     * @see FuelStation#number_of_employees
-     */
-    public LargeFuelStation(String supermarket_company, byte number_of_employees) {
-        super(number_of_employees, Size.LARGE, new Fuel[] { new Fuel(FuelType.SUPER, 8000f, 1.7f, 16000),
+        super(NUMBER_OF_EMPLOYEES, Size.LARGE, new Fuel[] { new Fuel(FuelType.SUPER, 8000f, 1.7f, 16000),
                 new Fuel(FuelType.SUPER_E10, 8000f, 1.7f, 16000),
                 new Fuel(FuelType.DIESEL, 8000f, 1.7f, 16000),
                 new Fuel(FuelType.PREMIUM_DIESEL, 8000f, 1.7f, 16000),
index 9b7bd553295fb2956e31b64abf548985c24baafc..bbabcfaa9eca18ace1ddf9563394aa84e81c3dfd 100644 (file)
@@ -4,6 +4,10 @@ package de.diejungsvondertanke.tankstelle;
  * Medium {@link FuelStation fuel station}
  */
 public class MediumFuelStation extends FuelStation {
+    /**
+     * Number of employees
+     */
+    public static final byte NUMBER_OF_EMPLOYEES = 2;
     /**
      * m² of retail space
      */
@@ -16,23 +20,7 @@ public class MediumFuelStation extends FuelStation {
      * @see #retail_space retail_space
      */
     public MediumFuelStation(float retail_space) {
-        super((byte) 2, Size.MEDIUM, new Fuel[] { new Fuel(FuelType.SUPER, 6000f, 1.7f, 12000),
-                new Fuel(FuelType.SUPER_E10, 6000f, 1.7f, 12000),
-                new Fuel(FuelType.PREMIUM_DIESEL, 6000f, 1.7f, 12000),
-                new Fuel(FuelType.AUTOGAS, 6000f, 1.7f, 12000) });
-        this.retail_space = retail_space;
-    }
-
-    /**
-     * Constructs medium {@link FuelStation fuel station}s
-     * 
-     * @param retail_space        m² of retail space
-     * @param number_of_employees Number of employees
-     * @see #retail_space
-     * @see FuelStation#number_of_employees
-     */
-    public MediumFuelStation(float retail_space, byte number_of_employees) {
-        super(number_of_employees, Size.MEDIUM, new Fuel[] { new Fuel(FuelType.SUPER, 6000f, 1.7f, 12000),
+        super(NUMBER_OF_EMPLOYEES, Size.MEDIUM, new Fuel[] { new Fuel(FuelType.SUPER, 6000f, 1.7f, 12000),
                 new Fuel(FuelType.SUPER_E10, 6000f, 1.7f, 12000),
                 new Fuel(FuelType.PREMIUM_DIESEL, 6000f, 1.7f, 12000),
                 new Fuel(FuelType.AUTOGAS, 6000f, 1.7f, 12000) });
index 96f379a2c8eb0395b725f0439787fecc1c441ffc..6f660b6bcf5f9133cd5337a333d02461ee2639f4 100644 (file)
@@ -5,32 +5,23 @@ package de.diejungsvondertanke.tankstelle;
  */
 public class SmallFuelStation extends FuelStation {
     /**
-     * Number of drink vending machines
+     * Number of employees
      */
-    private short number_of_vending_machines;
+    public static final byte NUMBER_OF_EMPLOYEES = 1;
 
     /**
-     * Constructs small {@link FuelStation fuel station}s
-     * 
-     * @param number_of_vending_machines Number of drink vending machines
-     * @see #number_of_vending_machines
+     * Number of drink vending machines
      */
-    public SmallFuelStation(short number_of_vending_machines) {
-        super((byte) 1, Size.SMALL, new Fuel[] { new Fuel(FuelType.SUPER, 4000f, 1.68f, 8000),
-                new Fuel(FuelType.DIESEL, 4000f, 1.7f, 8000) });
-        this.number_of_vending_machines = number_of_vending_machines;
-    }
+    private short number_of_vending_machines;
 
     /**
      * Constructs small {@link FuelStation fuel station}s
      * 
      * @param number_of_vending_machines Number of drink vending machines
-     * @param number_of_employees        Number of employees
      * @see #number_of_vending_machines
-     * @see FuelStation#number_of_employees
      */
-    public SmallFuelStation(short number_of_vending_machines, byte number_of_employees) {
-        super(number_of_employees, Size.SMALL, new Fuel[] { new Fuel(FuelType.SUPER, 4000f, 1.68f, 8000),
+    public SmallFuelStation(short number_of_vending_machines) {
+        super(NUMBER_OF_EMPLOYEES, Size.SMALL, new Fuel[] { new Fuel(FuelType.SUPER, 4000f, 1.68f, 8000),
                 new Fuel(FuelType.DIESEL, 4000f, 1.7f, 8000) });
         this.number_of_vending_machines = number_of_vending_machines;
     }