(self, events_infos, state, old_soup, new_soup, obj_name, player_index)
Player added an ingredient to a pot
Player added an ingredient to a pot
Player added an ingredient to a pot
def log_object_potting(self, events_infos, state, old_soup, new_soup, obj_name, player_index):
        """Player added an ingredient to a pot"""
        obj_pickup_key = "potting_" + obj_name
        if obj_pickup_key not in events_infos:
            raise ValueError("Unknown event {}".format(obj_pickup_key))
        events_infos[obj_pickup_key][player_index] = True

        POTTING_FNS = {
            "optimal" : self.is_potting_optimal,
            "catastrophic" : self.is_potting_catastrophic,
            "viable" : self.is_potting_viable,
            "useless" : self.is_potting_useless
        }

        for outcome, outcome_fn in POTTING_FNS.items():
            if outcome_fn(state, old_soup, new_soup):
                potting_key = "{}_{}_potting".format(outcome, obj_name)
                events_infos[potting_key][player_index] = True
def log_object_potting ( self , events_infos , state , old_soup , new_soup , obj_name , player_index ) : obj_pickup_key = "potting_" + obj_name if obj_pickup_key not in events_infos : raise ValueError ( "Unknown event {}" . format ( obj_pickup_key ) ) events_infos [ obj_pickup_key ] [ player_index ] = True POTTING_FNS = { "optimal" : self . is_potting_optimal , "catastrophic" : self . is_potting_catastrophic , "viable" : self . is_potting_viable , "useless" : self . is_potting_useless } for outcome , outcome_fn in POTTING_FNS . items ( ) : if outcome_fn ( state , old_soup , new_soup ) : potting_key = "{}_{}_potting" . format ( outcome , obj_name ) events_infos [ potting_key ] [ player_index ] = True