✨ 现在可以正常开垦了(但是开垦数据有待填写

⚡️ 优化部分代码
🐛 修复无法偷菜的BUG
This commit is contained in:
2025-04-07 18:52:27 +08:00
parent 98ae76560b
commit 38a23ca6d7
6 changed files with 400 additions and 268 deletions
+8 -8
View File
@@ -11,10 +11,10 @@ g_sResourcePath = Path(__file__).resolve().parent / "resource"
class CJsonManager:
def __init__(self):
self.m_pItem = None
self.m_pPlant = None
self.m_pLevel = None
self.m_pSoil = None
self.m_pItem = {}
self.m_pPlant = {}
self.m_pLevel = {}
self.m_pSoil = {}
async def init(self) -> bool:
if not await self.initItem():
@@ -79,10 +79,10 @@ class CJsonManager:
return True
except FileNotFoundError:
logger.warning("plant.json 打开失败")
logger.warning("level.json 打开失败")
return False
except json.JSONDecodeError as e:
logger.warning(f"plant.json JSON格式错误: {e}")
logger.warning(f"level.json JSON格式错误: {e}")
return False
async def initSoil(self) -> bool:
@@ -97,10 +97,10 @@ class CJsonManager:
return True
except FileNotFoundError:
logger.warning("plant.json 打开失败")
logger.warning("soil.json 打开失败")
return False
except json.JSONDecodeError as e:
logger.warning(f"plant.json JSON格式错误: {e}")
logger.warning(f"soil.json JSON格式错误: {e}")
return False
g_pJsonManager = CJsonManager()