🎨 新增Player类 更改项目文件结构

This commit is contained in:
2025-10-20 23:24:33 +08:00
parent 7bda14ea81
commit 00948cffb1
26 changed files with 1536 additions and 883 deletions
+43
View File
@@ -0,0 +1,43 @@
class CDBService:
async def init(self):
from .database.plant import CPlantManager
from .database.user import CUserDB
from .database.userItem import CUserItemDB
from .database.userPlant import CUserPlantDB
from .database.userSeed import CUserSeedDB
from .database.userSign import CUserSignDB
from .database.userSoil import CUserSoilDB
from .database.userSteal import CUserStealDB
self.plant = CPlantManager()
await self.plant.init()
self.user = CUserDB()
await self.user.initDB()
self.userSoil = CUserSoilDB()
await self.userSoil.initDB()
self.userPlant = CUserPlantDB()
await self.userPlant.initDB()
self.userSeed = CUserSeedDB()
await self.userSeed.initDB()
self.userItem = CUserItemDB()
await self.userItem.initDB()
self.userSteal = CUserStealDB()
await self.userSteal.initDB()
self.userSign = CUserSignDB()
await self.userSign.initDB()
# 迁移旧数据库
await self.userSoil.migrateOldFarmData()
async def cleanup(self):
await self.plant.cleanup()
g_pDBService = CDBService()