]> Git Server - tankstelle.git/commitdiff
added max. fuel capacity
authorRobin Cheney <cheneyr@eternal.ddnss.de>
Wed, 5 Nov 2025 11:57:56 +0000 (12:57 +0100)
committerRobin Cheney <cheneyr@eternal.ddnss.de>
Wed, 5 Nov 2025 11:57:56 +0000 (12:57 +0100)
.gitignore [deleted file]
src/main/java/de/tankstelle/GrosseTankstelle.java
src/main/java/de/tankstelle/KleineTankstelle.java
src/main/java/de/tankstelle/MittlereTankstelle.java
src/main/java/de/tankstelle/Treibstoff.java

diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index 0ed45c8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-target/classes/de/tankstelle/Main.class
-target/classes/de/tankstelle/Treibstoff.class
-target/classes/de/tankstelle/Treibstofftyp.class
-target/classes/de/tankstelle/Tankstelle.class
-target/classes/de/tankstelle/GrosseTankstelle.class
-target/classes/de/tankstelle/KleineTankstelle.class
-target/classes/de/tankstelle/MittlereTankstelle.class
\ No newline at end of file
index 96e11572399d033d53d67e257a7bbd138231baa4..c0ebff824c17257e6517837b79016bbaffff5ac9 100644 (file)
@@ -4,11 +4,11 @@ public class GrosseTankstelle extends Tankstelle {
     private String betreiberfirma_supermarkt;
 
     public GrosseTankstelle(String betreiberfirma_supermarkt) {
-        Treibstoff[] treibstoffe = { new Treibstoff(Treibstofftyp.SUPER, 16000f, 0f),
-                new Treibstoff(Treibstofftyp.SUPER_E10, 16000f, 0f),
-                new Treibstoff(Treibstofftyp.DIESEL, 16000f, 0f),
-                new Treibstoff(Treibstofftyp.PREMIUM_DIESEL, 16000f, 0f),
-                new Treibstoff(Treibstofftyp.AUTOGAS, 16000f, 0f) };
+        Treibstoff[] treibstoffe = { new Treibstoff(Treibstofftyp.SUPER, 8000f, 0f, 16000),
+                new Treibstoff(Treibstofftyp.SUPER_E10, 8000f, 0f, 16000),
+                new Treibstoff(Treibstofftyp.DIESEL, 8000f, 0f, 16000),
+                new Treibstoff(Treibstofftyp.PREMIUM_DIESEL, 8000f, 0f, 16000),
+                new Treibstoff(Treibstofftyp.AUTOGAS, 8000f, 0f, 16000) };
         super((byte) 4, treibstoffe);
 
         this.betreiberfirma_supermarkt = betreiberfirma_supermarkt;
index 2302d008513312bfd15bae86e94ea5a67d3b9219..68a8a448248ac6d3bfd984b1c4d70f4f726ed072 100644 (file)
@@ -4,8 +4,8 @@ public class KleineTankstelle extends Tankstelle {
     private short anzahl_getraenkeautomaten;
 
     public KleineTankstelle(short anzahl_getraenkeautomaten) {
-        Treibstoff[] treibstoffe = { new Treibstoff(Treibstofftyp.SUPER, 8000f, 0f),
-                new Treibstoff(Treibstofftyp.DIESEL, 8000f, 0f) };
+        Treibstoff[] treibstoffe = { new Treibstoff(Treibstofftyp.SUPER, 4000f, 0f, 8000),
+                new Treibstoff(Treibstofftyp.DIESEL, 4000f, 0f, 8000) };
         super((byte) 4, treibstoffe);
         this.anzahl_getraenkeautomaten = anzahl_getraenkeautomaten;
     }
index f96c6a7aed237606b6dfed2ecb430356253e9193..0c0bfde543591f07b7c19186163d587f886c5c52 100644 (file)
@@ -4,10 +4,10 @@ public class MittlereTankstelle extends Tankstelle {
     private short quadratmeterzahl_verkaufsflaeche;
 
     public MittlereTankstelle(short quadratmeterzahl_verkaufsflaeche) {
-        Treibstoff[] treibstoffe = { new Treibstoff(Treibstofftyp.SUPER, 12000f, 0f),
-                new Treibstoff(Treibstofftyp.SUPER_E10, 12000f, 0f),
-                new Treibstoff(Treibstofftyp.PREMIUM_DIESEL, 12000f, 0f),
-                new Treibstoff(Treibstofftyp.AUTOGAS, 12000f, 0f) };
+        Treibstoff[] treibstoffe = { new Treibstoff(Treibstofftyp.SUPER, 6000f, 0f, 12000),
+                new Treibstoff(Treibstofftyp.SUPER_E10, 6000f, 0f, 12000),
+                new Treibstoff(Treibstofftyp.PREMIUM_DIESEL, 6000f, 0f, 12000),
+                new Treibstoff(Treibstofftyp.AUTOGAS, 6000f, 0f, 12000) };
         super((byte) 4, treibstoffe);
         this.quadratmeterzahl_verkaufsflaeche = quadratmeterzahl_verkaufsflaeche;
     }
index 4751d3a99e2cc453c2cb065336870c708b7b090a..d851bc38bf8d3b54c1d563481cc3277292a243d5 100644 (file)
@@ -2,7 +2,8 @@ package de.tankstelle;
 
 public class Treibstoff {
     /**
-     * Der Treibstofftyp. Wird sich innerhalb einer Instanz nicht ändern und ist deshalb final
+     * Der Treibstofftyp. Wird sich innerhalb einer Instanz nicht ändern und ist
+     * deshalb final
      */
     public final Treibstofftyp TREIBSTOFFTYP;
 
@@ -11,14 +12,20 @@ public class Treibstoff {
      */
     public float menge;
 
+    /**
+     * Größtmöglicher Treibstoffvorrat
+     */
+    public final int KAPAZITAET;
+
     /**
      * Verkaufspreis / L
      */
     public float preis;
 
-    Treibstoff(Treibstofftyp Treibstofftyp, float menge, float preis) {
+    Treibstoff(Treibstofftyp Treibstofftyp, float menge, float preis, int kapazitaet) {
         this.TREIBSTOFFTYP = Treibstofftyp;
         this.menge = menge;
         this.preis = preis;
+        this.KAPAZITAET = kapazitaet;
     }
 }