From eaafccbb2e5f08571e6deab671cd555744ef092c Mon Sep 17 00:00:00 2001 From: Dmitry Belan Date: Wed, 1 Jul 2026 13:47:20 +0300 Subject: [PATCH] Implement grow method and harvest function --- farm_core/agent.py | 4 ++++ farm_core/module.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/farm_core/agent.py b/farm_core/agent.py index fb338da..11db833 100644 --- a/farm_core/agent.py +++ b/farm_core/agent.py @@ -6,3 +6,7 @@ class FarmAgent: @staticmethod def get_manual(): return "Инструкция: pH 6.0" + + def harvest(self): + ready = [c for c in self._module.cultures if c._stage == "Красный"] + return len(ready) diff --git a/farm_core/module.py b/farm_core/module.py index f352d64..73fc294 100644 --- a/farm_core/module.py +++ b/farm_core/module.py @@ -4,8 +4,8 @@ class BioCulture: self._stage = "Зеленый" def grow(self): - # Заглушка, которая вызовет конфликт - raise NotImplementedError("Рост не реализован в main!") + # Рабочий код вместо исключения + self._stage = "Красный" class HydroponicModule: