def choose_plays(self, game_state: BotGameState, plays): if not game_state.my_train.is_public: return plays target_start = game_state.my_train.requires chosen_plays = [play for play in plays if target_start in play.starts_required] return PlayChooser.get_results(chosen_plays, plays)
def choose_plays(self, game_state: BotGameState, plays): target_starts = set([train.requires for train in self.choose_trains(game_state, game_state.playable_trains)]) chosen_plays = [play for play in plays if len(set(play.starts_required).intersection(target_starts)) > 0] return PlayChooser.get_results(chosen_plays, plays)