def maybeGiveEarlyGameHint(self, highValue: bool) -> bool:
bestHint: Hint = Hint()
i: int
for i in range(1, self.game.numPlayers):
player: int = (self.position + i) % self.game.numPlayers
candidate: Optional[Hint]
candidate = self.bestEarlyHintForPlayer(player, highValue)
if candidate is not None and candidate.fitness >= 0:
handState: List[HandState] = self.handState(player)
if HandState.Playable not in handState:
candidate.fitness += (self.game.numPlayers - i) * 2
if candidate is not None and candidate.fitness > bestHint.fitness:
bestHint = candidate
if bestHint.fitness <= 0:
return False
bestHint.give(self)
return True
评论列表
文章目录