1
0
forked from s444426/AIProjekt
AIProjekt/Podprojekt_s444426/cabbage_upgrade.py

26 lines
699 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 Cabbage(Plant):
2020-06-09 15:28:02 +02:00
2020-05-26 23:15:49 +02:00
def __init__(self, collect):
super().__init__('cabbage', 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 < 85:
return 'False'
elif 85 <= self._collect <= 100:
return 'True'
elif self._collect > 100:
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 <= 45:
return True
else:
2020-06-09 15:28:02 +02:00
return False