updated some trailer data #13
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
40
trailer.py
40
trailer.py
@ -1,32 +1,48 @@
|
||||
class Trailer:
|
||||
from enum import Enum
|
||||
|
||||
def __init__(self, capacity, _type, priority, weight):
|
||||
self.capacity = capacity
|
||||
class Priorities(Enum):
|
||||
SMALLEST = 0
|
||||
MEDIUM = 2
|
||||
HIGH = 3
|
||||
HIGHEST = 4
|
||||
|
||||
@staticmethod
|
||||
def whatIsFirst(_prio1, _prio2):
|
||||
if(_prio1 > _prio2):
|
||||
return _prio1
|
||||
elif _prio2 >= _prio1:
|
||||
return _prio2
|
||||
|
||||
|
||||
class Trailer:
|
||||
def __init__(self, _type: str, priority: Priorities, weight: float):
|
||||
self.capacity = 1.0
|
||||
self.type = _type
|
||||
self.priority = priority
|
||||
self.weight = weight
|
||||
self.grossWeight = weight
|
||||
|
||||
def getWeight(self):
|
||||
return self.grossWeight + self.capacity
|
||||
|
||||
def use(self):
|
||||
self.capacity -= 0.1
|
||||
|
||||
class Fertilizer(Trailer): # do nawożenia
|
||||
|
||||
def __init__(self):
|
||||
super(Fertilizer, self).__init__(capacity=1, _type="Fertilizer", priority=1, weight=1) # parametry do uzupełnienia
|
||||
super(Fertilizer, self).__init__("Fertilizer", Priorities.SMALLEST, 100) # parametry do uzupełnienia
|
||||
|
||||
|
||||
class Water(Trailer): # do podlewania
|
||||
|
||||
def __init__(self):
|
||||
super(Water, self).__init__(capacity=1, _type="Water", priority=1, weight=1) # parametry do uzupełnienia
|
||||
super(Water, self).__init__("Water", Priorities.HIGH, 2000) # parametry do uzupełnienia
|
||||
|
||||
|
||||
class Harvest(Trailer): # do zbierania
|
||||
|
||||
def __init__(self):
|
||||
super(Harvest, self).__init__(capacity=1, _type="Harvest", priority=1, weight=1) # parametry do uzupełnienia
|
||||
super(Harvest, self).__init__("Harvest", Priorities.SMALLEST, 500) # parametry do uzupełnienia
|
||||
|
||||
|
||||
class Sow(Trailer): # do siania
|
||||
|
||||
def __init__(self):
|
||||
super(Sow, self).__init__(capacity=1, _type="Sow", priority=1, weight=1) # parametry do uzupełnienia
|
||||
super(Sow, self).__init__("Sow", Priorities.HIGHEST, 200) # parametry do uzupełnienia
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user