def update_game_state(self) -> None:
c: Color
v: Value
discards: Dict[Color, List[int]]
discards = {c: [0] * 6 for c in self.game.variant.pile_colors}
d: int
for d in self.game.discards:
ci: CardInfo = gameCards[d]
discards[ci.color][ci.value] += 1
self.nextCardPlay: Dict[Color, int]
self.nextCardPlay = {c: len(self.game.playedCards[c]) + 1
for c in self.game.variant.pile_colors}
self.maxCardPlay: Dict[Color, Value]
self.maxCardPlay = {c: Value.V5 for c in self.game.variant.pile_colors}
for c in self.game.variant.pile_colors:
for v in reversed(Value): # type: ignore
if discards[c][v] < v.num_copies:
self.maxCardPlay[c] = v
break
评论列表
文章目录