diff --git a/fleet.py b/fleet.py index b5e4543..4b67f14 100644 --- a/fleet.py +++ b/fleet.py @@ -1,3 +1,4 @@ +from abc import ABC, abstractmethod class Fleet(): vehicles = ["7E19H2", "N9460G32581A3", "BN4681"] @@ -24,7 +25,24 @@ vehicle1.displayAllFleetMembers() addVehicle = Fleet("hovercraft", 50, "ground/water", 0) -addVehicle.addVehicles(str(input("Enter vehicle identifier"))) - vehicle1.displayAllFleetMembers() - \ No newline at end of file + + +class Vehicle(ABC): + '''Defines the properties of vehicles''' + + # https://www.geeksforgeeks.org/inheritance-and-composition-in-python/ + @abstractmethod + def __init__(self, gpsPosition, velocity, weight, velocityType, weightType): + self.vehicleObject = Fleet() + self.gpsPosition = [0,0] + self.velocity = 0 + self.velocityType = "kph" + self.weightType = "kg" + self.weight = 0 + +class GroundVehicle:(ABC, Vehicle) +'''Doc string goes here''' + + # @abstractmethod + # def __init__(self): \ No newline at end of file diff --git a/vehicle.py b/vehicle.py deleted file mode 100644 index 3ec8de6..0000000 --- a/vehicle.py +++ /dev/null @@ -1,4 +0,0 @@ -class Vehicle(): - '''Defines the properties of ground vehicles''' - - def __init__(self): \ No newline at end of file