From fe44b4ffa575602af11ad6006d0d5c8453304ec2 Mon Sep 17 00:00:00 2001 From: Emil Gutkiewicz Date: Fri, 25 Mar 2022 10:01:12 +0100 Subject: [PATCH] updated some trailer data --- __pycache__/agent.cpython-38.pyc | Bin 1861 -> 1851 bytes __pycache__/common.cpython-38.pyc | Bin 704 -> 694 bytes __pycache__/field.cpython-38.pyc | Bin 4234 -> 4224 bytes __pycache__/settings.cpython-38.pyc | Bin 1700 -> 1690 bytes trailer.py | 40 +++++++++++++++++++--------- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/__pycache__/agent.cpython-38.pyc b/__pycache__/agent.cpython-38.pyc index 7fecea2bba6af01dd082642a310d3faf2db739d7..851941efcd1bab5035dcb7cc5129218e6ab88517 100644 GIT binary patch delta 62 zcmX@gx0{bEl$V!_0SIDqH*ys)s_N-yld4tS{fUe>z5QIW|!m_ Q>E|XEm!xi9$vB4<0359oMF0Q* delta 72 zcmdnZca)DSl$V!_0SKziHgXj(>Rae%IYX< aCM9R)7X{}g7L|k)C1#i8Z=TOMhZO)3rWjZN diff --git a/__pycache__/common.cpython-38.pyc b/__pycache__/common.cpython-38.pyc index 3523410b4d631a68ba3f77200360b750562b9feb..64eca0d9d66ace3a8a42ae603eb47a2ed2f238ef 100644 GIT binary patch delta 62 zcmX@Wx{Z}Pl$V!_0SIDqZ6|VHQPtPa$j?pHFD@xfNzE%M)-N_OwKO&`*Donb%r40< Q($7sSE=k?Y$GC|R04b~!BLDyZ delta 72 zcmdnSdVrNXl$V!_0SJV5Xien4qHn36k)NBYpPHMQqhC;zpOu=-=& diff --git a/__pycache__/field.cpython-38.pyc b/__pycache__/field.cpython-38.pyc index fd34ce30d2eb58f7bf19eee206fafd12e835dd57..6acf55c70eea0afd01a1fe0f91c8efae9eb3b4b4 100644 GIT binary patch delta 1646 zcma)+OHUI~6vv&;v`kB93I^1Iq6Ht6*C0@df~151#zZ0!i8jGf+5rkPExGp+gBxAA zk;K*Axp&dTjqwv0m#$oy+>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ieGt;{U+GBro|VCBvs9GspGScyxJs7~O+L$GSzRC~LWL@pd+= zl{E`CVgV;NTRysO<2>gGH$_NTQl5~*q5-@yz7~Pj~{KFII U94y*ADj9*hx#>^gt8JtI0143vQvd(} diff --git a/__pycache__/settings.cpython-38.pyc b/__pycache__/settings.cpython-38.pyc index 63ef74460fe88d6a9aa559ef77ff23185db58d3c..ca9dbf7d2f28fd49ceed7ddaf07a33c82625a419 100644 GIT binary patch delta 61 zcmZ3&JBybql$V!_0SIDqCvrVkHPp|@&rQ`YE-6h(%_}L^FE%l?G&V5TFDXjQF3B&_ P&rK{YN!_f#*un|`6^t^pPQ~vm6}{qtY2JGnv$8QA6!+L Zl$@Dg6r7t_R1#8@m|c>;S&XrT6#yB*7z_Xa diff --git a/trailer.py b/trailer.py index b44a0ab..6112dd5 100644 --- a/trailer.py +++ b/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 -- 2.20.1