uebung05 ende
This commit is contained in:
parent
cd913d2703
commit
6efe637f23
@ -11,10 +11,10 @@ import logistics.material.ShellBatches;
|
|||||||
public class Demo {
|
public class Demo {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final Manager manager = new Manager();
|
final Manager manager = new Manager();
|
||||||
manager.addVehicle(new Tank("Leo1"));
|
manager.addVehicle(new Tank("Leo1", 50, 2, 3));
|
||||||
manager.addVehicle(new Tank("Leo2"));
|
manager.addVehicle(new Tank("Leo2", 60, 3, 4));
|
||||||
manager.addVehicle(new Helicopter("Tiger1"));
|
manager.addVehicle(new Helicopter("Tiger1", 300, 2, 5));
|
||||||
manager.addVehicle(new Helicopter("Tiger2"));
|
manager.addVehicle(new Helicopter("Tiger2", 400, 7, 8));
|
||||||
System.out.println();
|
System.out.println();
|
||||||
manager.showOverallNeed();
|
manager.showOverallNeed();
|
||||||
System.out.println();
|
System.out.println();
|
||||||
|
50
uebung05/src/logistics/Helicopter.java
Normal file
50
uebung05/src/logistics/Helicopter.java
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package logistics;
|
||||||
|
|
||||||
|
import logistics.material.BulletBelts;
|
||||||
|
import logistics.material.MetGallonsKerosene;
|
||||||
|
import logistics.material.RocketPods;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
import logistics.storage.FloatStorage;
|
||||||
|
import logistics.storage.IntStorage;
|
||||||
|
|
||||||
|
public class Helicopter extends Vehicle {
|
||||||
|
|
||||||
|
public IntStorage bullets;
|
||||||
|
public IntStorage rockets;
|
||||||
|
public FloatStorage tank;
|
||||||
|
|
||||||
|
public Helicopter(String name, float kerosene, int bulletBelts, int rocketPods) {
|
||||||
|
super(name);
|
||||||
|
this.tank = new FloatStorage(kerosene, MetGallonsKerosene.INSTANCE, 500);
|
||||||
|
bullets = new IntStorage(bulletBelts, BulletBelts.INSTANCE, 2);
|
||||||
|
rockets = new IntStorage(rocketPods, RocketPods.INSTANCE, 2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportNeeds(NeedCollector collector) {
|
||||||
|
oil.reportNeed(collector);
|
||||||
|
grease.reportNeed(collector);
|
||||||
|
tank.reportNeed(collector);
|
||||||
|
bullets.reportNeed(collector);
|
||||||
|
rockets.reportNeed(collector);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillUpAll() {
|
||||||
|
oil.fillUp();
|
||||||
|
grease.fillUp();
|
||||||
|
tank.fillUp();
|
||||||
|
bullets.fillUp();
|
||||||
|
rockets.fillUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consumeAll(int intensityRate) {
|
||||||
|
tank.consume(intensityRate * 200);
|
||||||
|
bullets.consume(intensityRate);
|
||||||
|
rockets.consume(intensityRate);
|
||||||
|
oil.consume(1);
|
||||||
|
grease.consume(1);
|
||||||
|
}
|
||||||
|
}
|
54
uebung05/src/logistics/Manager.java
Normal file
54
uebung05/src/logistics/Manager.java
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
package logistics;
|
||||||
|
|
||||||
|
import logistics.quantities.FloatUnit;
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Manager {
|
||||||
|
|
||||||
|
private final List<Vehicle> vehicles = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
public void addVehicle(Vehicle vehicle) {
|
||||||
|
vehicles.add(vehicle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillUpVehicles() {
|
||||||
|
for (Vehicle vehicle : vehicles) {
|
||||||
|
vehicle.fillUpAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void logTick(int intensityRate) {
|
||||||
|
for (Vehicle vehicle : vehicles) {
|
||||||
|
vehicle.consumeAll(intensityRate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public NeedCollector collectNeeds() {
|
||||||
|
NeedCollector collector = new NeedCollector();
|
||||||
|
for (Vehicle vehicle : vehicles) {
|
||||||
|
vehicle.reportNeeds(collector);
|
||||||
|
}
|
||||||
|
return collector;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showOverallNeed() {
|
||||||
|
collectNeeds().show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showNeed(IntUnit unit) {
|
||||||
|
NeedCollector collector = collectNeeds();
|
||||||
|
System.out.println(collector.getNeed(unit));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showNeed(FloatUnit unit) {
|
||||||
|
NeedCollector collector = collectNeeds();
|
||||||
|
System.out.println(collector.getNeed(unit));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
47
uebung05/src/logistics/Tank.java
Normal file
47
uebung05/src/logistics/Tank.java
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package logistics;
|
||||||
|
|
||||||
|
|
||||||
|
import logistics.material.BulletBelts;
|
||||||
|
import logistics.material.LiterDiesel;
|
||||||
|
import logistics.material.ShellBatches;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
import logistics.storage.FloatStorage;
|
||||||
|
import logistics.storage.IntStorage;
|
||||||
|
|
||||||
|
public class Tank extends Vehicle {
|
||||||
|
public final IntStorage bullets;
|
||||||
|
public final IntStorage shells;
|
||||||
|
public final FloatStorage tank;
|
||||||
|
|
||||||
|
public Tank(String name, float diesel,int bulletBelts, int shellBatches) {
|
||||||
|
super(name);
|
||||||
|
bullets = new IntStorage(bulletBelts, BulletBelts.INSTANCE, 10);
|
||||||
|
shells = new IntStorage(shellBatches, ShellBatches.INSTANCE, 10);
|
||||||
|
tank = new FloatStorage(diesel, LiterDiesel.INSTANCE, 1200);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportNeeds(NeedCollector collector) {
|
||||||
|
super.reportNeedsSuper(collector);
|
||||||
|
bullets.reportNeed(collector);
|
||||||
|
shells.reportNeed(collector);
|
||||||
|
tank.reportNeed(collector);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillUpAll() {
|
||||||
|
super.fillUpAllSuper();
|
||||||
|
bullets.fillUp();
|
||||||
|
shells.fillUp();
|
||||||
|
tank.fillUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consumeAll(int intesity) {
|
||||||
|
super.consumeAll();
|
||||||
|
bullets.consume(intesity*2);
|
||||||
|
tank.consume(intesity*180f);
|
||||||
|
shells.consume(intesity*2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
45
uebung05/src/logistics/Truck.java
Normal file
45
uebung05/src/logistics/Truck.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package logistics;
|
||||||
|
|
||||||
|
import logistics.material.BulletBelts;
|
||||||
|
import logistics.material.LiterDiesel;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
import logistics.storage.FloatStorage;
|
||||||
|
import logistics.storage.IntStorage;
|
||||||
|
|
||||||
|
public class Truck extends Vehicle {
|
||||||
|
private final FloatStorage tank;
|
||||||
|
private final IntStorage bullets;
|
||||||
|
|
||||||
|
public Truck(String name, float diesel, int bullets) {
|
||||||
|
super(name);
|
||||||
|
this.tank = new FloatStorage(diesel, LiterDiesel.INSTANCE, 180);
|
||||||
|
this.bullets = new IntStorage(bullets, BulletBelts.INSTANCE, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consumeAll(int intensity) {
|
||||||
|
oil.consume(1);
|
||||||
|
grease.consume(1);
|
||||||
|
tank.consume(intensity * 25);
|
||||||
|
bullets.consume(intensity * 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportNeeds(NeedCollector collector) {
|
||||||
|
oil.reportNeed(collector);
|
||||||
|
grease.reportNeed(collector);
|
||||||
|
tank.reportNeed(collector);
|
||||||
|
bullets.reportNeed(collector);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillUpAll() {
|
||||||
|
oil.fillUp();
|
||||||
|
grease.fillUp();
|
||||||
|
tank.fillUp();
|
||||||
|
bullets.fillUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
43
uebung05/src/logistics/Vehicle.java
Normal file
43
uebung05/src/logistics/Vehicle.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package logistics;
|
||||||
|
|
||||||
|
import logistics.material.Grease;
|
||||||
|
import logistics.material.Oil;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
import logistics.storage.IntStorage;
|
||||||
|
|
||||||
|
public abstract class Vehicle {
|
||||||
|
public String name;
|
||||||
|
public IntStorage oil;
|
||||||
|
public IntStorage grease;
|
||||||
|
|
||||||
|
public Vehicle(String name) {
|
||||||
|
this.name = name;
|
||||||
|
this.oil = new IntStorage(0, Oil.INSTANCE, 3);
|
||||||
|
this.grease = new IntStorage(0, Grease.INSTANCE, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void reportNeeds(NeedCollector collector);
|
||||||
|
|
||||||
|
public abstract void fillUpAll();
|
||||||
|
|
||||||
|
public abstract void consumeAll(int intensity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void consumeAll(){
|
||||||
|
oil.consume(1);
|
||||||
|
grease.consume(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillUpAllSuper(){
|
||||||
|
oil.fillUp();
|
||||||
|
grease.fillUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reportNeedsSuper(NeedCollector collector){
|
||||||
|
oil.reportNeed(collector);
|
||||||
|
grease.reportNeed(collector);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
14
uebung05/src/logistics/material/BulletBelts.java
Normal file
14
uebung05/src/logistics/material/BulletBelts.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
|
||||||
|
public class BulletBelts implements IntUnit{
|
||||||
|
public static BulletBelts INSTANCE = new BulletBelts();
|
||||||
|
|
||||||
|
private BulletBelts() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "belts of 7.62 bullets";
|
||||||
|
}
|
||||||
|
}
|
15
uebung05/src/logistics/material/Grease.java
Normal file
15
uebung05/src/logistics/material/Grease.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
|
||||||
|
public class Grease implements IntUnit{
|
||||||
|
public static Grease INSTANCE = new Grease();
|
||||||
|
|
||||||
|
private Grease() {}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "units of grease";
|
||||||
|
}
|
||||||
|
}
|
14
uebung05/src/logistics/material/LiterDiesel.java
Normal file
14
uebung05/src/logistics/material/LiterDiesel.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.FloatUnit;
|
||||||
|
|
||||||
|
public class LiterDiesel implements FloatUnit{
|
||||||
|
public static LiterDiesel INSTANCE = new LiterDiesel();
|
||||||
|
|
||||||
|
private LiterDiesel() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "liters of diesel";
|
||||||
|
}
|
||||||
|
}
|
14
uebung05/src/logistics/material/MetGallonsKerosene.java
Normal file
14
uebung05/src/logistics/material/MetGallonsKerosene.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.FloatUnit;
|
||||||
|
|
||||||
|
public class MetGallonsKerosene implements FloatUnit{
|
||||||
|
public static MetGallonsKerosene INSTANCE = new MetGallonsKerosene();
|
||||||
|
|
||||||
|
private MetGallonsKerosene() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "met gallons of kerosene";
|
||||||
|
}
|
||||||
|
}
|
14
uebung05/src/logistics/material/Oil.java
Normal file
14
uebung05/src/logistics/material/Oil.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
|
||||||
|
public class Oil implements IntUnit{
|
||||||
|
public static Oil INSTANCE = new Oil();
|
||||||
|
|
||||||
|
private Oil() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "units of oil";
|
||||||
|
}
|
||||||
|
}
|
14
uebung05/src/logistics/material/RocketPods.java
Normal file
14
uebung05/src/logistics/material/RocketPods.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
|
||||||
|
public class RocketPods implements IntUnit{
|
||||||
|
public static RocketPods INSTANCE = new RocketPods();
|
||||||
|
|
||||||
|
private RocketPods() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "pods of 70mm rockets";
|
||||||
|
}
|
||||||
|
}
|
14
uebung05/src/logistics/material/ShellBatches.java
Normal file
14
uebung05/src/logistics/material/ShellBatches.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package logistics.material;
|
||||||
|
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
|
||||||
|
public class ShellBatches implements IntUnit{
|
||||||
|
public static ShellBatches INSTANCE = new ShellBatches();
|
||||||
|
|
||||||
|
private ShellBatches() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "batches of 120mm shells";
|
||||||
|
}
|
||||||
|
}
|
5
uebung05/src/logistics/quantities/FloatUnit.java
Normal file
5
uebung05/src/logistics/quantities/FloatUnit.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package logistics.quantities;
|
||||||
|
|
||||||
|
public interface FloatUnit {
|
||||||
|
|
||||||
|
}
|
5
uebung05/src/logistics/quantities/IntUnit.java
Normal file
5
uebung05/src/logistics/quantities/IntUnit.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package logistics.quantities;
|
||||||
|
|
||||||
|
public interface IntUnit {
|
||||||
|
|
||||||
|
}
|
43
uebung05/src/logistics/quantities/NeedCollector.java
Normal file
43
uebung05/src/logistics/quantities/NeedCollector.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package logistics.quantities;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class NeedCollector {
|
||||||
|
private Map<IntUnit, Integer> intNeeded = new HashMap<>();
|
||||||
|
private Map<FloatUnit, Float> floatNeeded;
|
||||||
|
|
||||||
|
public NeedCollector() {
|
||||||
|
// wird bei Deklaration initialisiert
|
||||||
|
//intNeeded = new HashMap<>();
|
||||||
|
floatNeeded = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(int amount, IntUnit unit) {
|
||||||
|
if (intNeeded.containsKey(unit)) {
|
||||||
|
intNeeded.put(unit, intNeeded.get(unit) + amount);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
intNeeded.put(unit, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(float amount, FloatUnit unit) {
|
||||||
|
if (floatNeeded.containsKey(unit))
|
||||||
|
floatNeeded.put(unit, floatNeeded.get(unit) + amount);
|
||||||
|
else
|
||||||
|
floatNeeded.put(unit, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNeed(IntUnit unit) {
|
||||||
|
return intNeeded.get(unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getNeed(FloatUnit unit) {
|
||||||
|
return floatNeeded.get(unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
System.out.println(intNeeded);
|
||||||
|
System.out.println(floatNeeded);
|
||||||
|
}
|
||||||
|
}
|
59
uebung05/src/logistics/storage/FloatStorage.java
Normal file
59
uebung05/src/logistics/storage/FloatStorage.java
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package logistics.storage;
|
||||||
|
|
||||||
|
import logistics.quantities.FloatUnit;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
|
||||||
|
public class FloatStorage {
|
||||||
|
|
||||||
|
private float stored;
|
||||||
|
private final FloatUnit unit;
|
||||||
|
private final float max;
|
||||||
|
|
||||||
|
public FloatStorage(float stored, FloatUnit unit, float max) {
|
||||||
|
if (stored < 0 || max < 0)
|
||||||
|
throw new IllegalArgumentException("negative");
|
||||||
|
this.stored = stored;
|
||||||
|
this.unit = unit;
|
||||||
|
this.max = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public float consume(float amount) {
|
||||||
|
if (amount < 0)
|
||||||
|
throw new IllegalArgumentException("negative");
|
||||||
|
amount = Math.min(amount, stored);
|
||||||
|
stored -= amount;
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fill(float amount) {
|
||||||
|
stored = Math.min(stored + amount, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillUp() {
|
||||||
|
stored = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reportNeed(NeedCollector collector) {
|
||||||
|
collector.add(max - stored, unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public float getStored() {
|
||||||
|
return stored;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FloatUnit getUnit() {
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMax() {
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "storage with " + stored + " of " + max + " " + unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
60
uebung05/src/logistics/storage/IntStorage.java
Normal file
60
uebung05/src/logistics/storage/IntStorage.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package logistics.storage;
|
||||||
|
|
||||||
|
import logistics.quantities.IntUnit;
|
||||||
|
import logistics.quantities.NeedCollector;
|
||||||
|
|
||||||
|
public class IntStorage {
|
||||||
|
private int stored;
|
||||||
|
private final IntUnit unit;
|
||||||
|
private final int max;
|
||||||
|
|
||||||
|
public IntStorage(int stored, IntUnit unit, int max) {
|
||||||
|
if (stored < 0 || max < 0)
|
||||||
|
throw new IllegalArgumentException("negative");
|
||||||
|
this.stored = Math.min(stored, max);
|
||||||
|
this.unit = unit;
|
||||||
|
this.max = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int consume(int amount) {
|
||||||
|
if (amount < 0)
|
||||||
|
throw new IllegalArgumentException("negative");
|
||||||
|
|
||||||
|
int result = Math.min(amount, stored);
|
||||||
|
stored -= result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fill(int amount) {
|
||||||
|
if (amount < 0) throw new IllegalArgumentException("negative");
|
||||||
|
stored = Math.min(stored + amount, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillUp() {
|
||||||
|
stored = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reportNeed(NeedCollector collector) {
|
||||||
|
collector.add(max - stored, unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getStored() {
|
||||||
|
return stored;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMax() {
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntUnit getUnit() {
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "storage with " + stored + " of " + max + " " + unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -20,10 +20,10 @@ public class ManagerTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
manager = new Manager();
|
manager = new Manager();
|
||||||
manager.addVehicle(new Tank("Leo1"));
|
manager.addVehicle(new Tank("Leo1", 50, 2, 3));
|
||||||
manager.addVehicle(new Tank("Leo2"));
|
manager.addVehicle(new Tank("Leo2", 60, 3, 4));
|
||||||
manager.addVehicle(new Helicopter("Tiger1"));
|
manager.addVehicle(new Helicopter("Tiger1", 300, 2, 5));
|
||||||
manager.addVehicle(new Helicopter("Tiger2"));
|
manager.addVehicle(new Helicopter("Tiger2", 400, 7, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user