updated some trailer data #13

Merged
s459307 merged 1 commits from trailer_update into master 2022-03-25 10:09:45 +01:00
5 changed files with 28 additions and 12 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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