Implement grow method and harvest function

This commit is contained in:
Dmitry Belan
2026-07-01 13:47:20 +03:00
parent 7291a46b6a
commit eaafccbb2e
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -6,3 +6,7 @@ class FarmAgent:
@staticmethod @staticmethod
def get_manual(): def get_manual():
return "Инструкция: pH 6.0" return "Инструкция: pH 6.0"
def harvest(self):
ready = [c for c in self._module.cultures if c._stage == "Красный"]
return len(ready)
+2 -2
View File
@@ -4,8 +4,8 @@ class BioCulture:
self._stage = "Зеленый" self._stage = "Зеленый"
def grow(self): def grow(self):
# Заглушка, которая вызовет конфликт # Рабочий код вместо исключения
raise NotImplementedError("Рост не реализован в main!") self._stage = "Красный"
class HydroponicModule: class HydroponicModule: