D.M.
zmiana fertilizing
This commit is contained in:
parent
b0154dc37e
commit
8feee67563
69
carrot.py
69
carrot.py
@ -1,34 +1,35 @@
|
||||
from plant import Plant
|
||||
from datetime import datetime
|
||||
|
||||
class Carrot(Plant):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._wasFertilized = False #roslina nie byla nawozona przy tworzeniu
|
||||
self._starttime = datetime.now()
|
||||
|
||||
def collect(self):
|
||||
if self.have_soil():
|
||||
self.__growing()
|
||||
if self._collect < 90:
|
||||
return 'False'
|
||||
elif 90 <= self._collect <= 105:
|
||||
return 'True'
|
||||
elif self._collect > 105:
|
||||
return 'Delete'
|
||||
|
||||
def fertillizing(self):
|
||||
if 30 <= self._collect <= 50:
|
||||
self._wasFertilized = True
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
#każde iles czasu zwieksza wzrost rosliny, wywolywana w momencie sprawdzania czy roslina jest gotowa do zbiorow
|
||||
def __growing(self):
|
||||
checktime = datetime.now()
|
||||
delta = checktime - self._starttime
|
||||
a = delta // 60
|
||||
self._collect += a
|
||||
self._starttime = checktime
|
||||
from plant import Plant
|
||||
from datetime import datetime
|
||||
|
||||
class Carrot(Plant):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._wasFertilized = False #roslina nie byla nawozona przy tworzeniu
|
||||
self._starttime = datetime.now()
|
||||
|
||||
#zwraca czy zbierać rośline
|
||||
def collect(self):
|
||||
if self.have_soil():
|
||||
self.__growing()
|
||||
if self._collect < 90:
|
||||
return 'False'
|
||||
elif 90 <= self._collect <= 105:
|
||||
return 'True'
|
||||
elif self._collect > 105:
|
||||
return 'Delete'
|
||||
|
||||
#zwraca czy nawozić
|
||||
def fertillizing(self):
|
||||
if 30 <= self._collect <= 50:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
#każde iles czasu zwieksza wzrost rosliny, wywolywana w momencie sprawdzania czy roslina jest gotowa do zbiorow
|
||||
def __growing(self):
|
||||
checktime = datetime.now()
|
||||
delta = checktime - self._starttime
|
||||
a = delta // 60
|
||||
self._collect += a
|
||||
self._starttime = checktime
|
||||
|
Loading…
Reference in New Issue
Block a user