def makeState(self, player): state = GameState() state.debug = self.debug # Pass copies, not the original objects, so the canonical ones can't # "accidentally" get modified by the AIs state.hand = copy(player.hand) state.discardPile = copy(self.discardPile) state.teams = deepcopy(self.teams) state.us = copy(self.teams[player.teamNumber]) state.opponents = deepcopy(self.teams) del state.opponents[(player.teamNumber)] # Passed by value, doesn't need copying state.target = self.target state.cardsLeft = self.deck.cardsLeft() state.playerCount = len(self.players) state.playerNumber = player.number return state