判定部分优化
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-19 18:48:10 +08:00
parent f7afe48680
commit f30ad0cb7d

View File

@ -158,14 +158,16 @@ class IdiomGame:
跳过当前成语,选择下一个成语
"""
await self.lock.acquire()
self._skip_idiom_async(buff_score)
self._skip_idiom_async()
self.add_buff_score(buff_score)
self.lock.release()
return self.last_idiom
def _skip_idiom_async(self, buff_score: int = -100) -> str:
def _skip_idiom_async(self) -> str:
self.last_idiom = secrets.choice(IdiomGame.ALL_IDIOMS)
self.last_char = self.last_idiom[-1]
self.add_buff_score(buff_score)
if not self.is_nextable(self.last_char):
self._skip_idiom_async()
return self.last_idiom
async def try_verify_idiom(self, idiom: str, user_id: str) -> TryVerifyState: