AIProjekt/Podprojekt_s444426/carrot_upgrade.py

26 lines
722 B
Python
Raw Normal View History

2020-05-26 23:15:49 +02:00
from plant_upgrade import Plant
from datetime import datetime
2020-06-09 15:28:02 +02:00
2020-05-26 23:15:49 +02:00
class Carrot(Plant):
2020-06-09 15:28:02 +02:00
2020-05-26 23:15:49 +02:00
def __init__(self, collect):
super().__init__('carrot', collect)
2020-06-09 15:28:02 +02:00
self._wasFertilized = False # roslina nie byla nawozona przy tworzeniu
2020-05-26 23:15:49 +02:00
2020-06-09 15:28:02 +02:00
# zwraca czy zbierać rośline
2020-05-26 23:15:49 +02:00
def collect(self):
if self.have_soil():
if self._collect < 90:
return 'False'
elif 90 <= self._collect <= 105:
return 'True'
elif self._collect > 105:
return 'Delete'
2020-06-09 15:28:02 +02:00
# zwraca czy nawozić
2020-05-26 23:15:49 +02:00
def fertillizing(self):
if 30 <= self._collect <= 50:
return True
else:
2020-06-09 15:28:02 +02:00
return False