def get_schedule(event):
    matches = TBA.get_event_matches(event)
    ddict = {}
    for match in matches:
        match_num = int(match["match_number"])
        ddict[match_num] = {}
        for alli in ["red", "blue"]:
            for i in range(1, 4):
                ddict[match_num][alli + str(i)] = int(match["alliances"][alli]["teams"][i-1][3:])
    return matches, ddict
def get_matches(event):
    match_json = TBA.get_event_matches(event)
    scores = []
    for match in match_json:
        if IGNORE_ELIMS and match["comp_level"] != "qm":
            continue
        if "frc0" in match["alliances"]["red"]["teams"] or "frc0" in match["alliances"]["blue"]["teams"]:
            continue
        for alli in ["red", "blue"]:
            alliance = [
                int(match["alliances"][alli]["teams"][0][3:]),
                int(match["alliances"][alli]["teams"][1][3:]),
                int(match["alliances"][alli]["teams"][2][3:]),
                match["alliances"][alli]["score"]
            ]
            scores.append(alliance)
    return scores
Beispiel #3
0
def load_matches(event_id):
    return TBA.get_event_matches(event_id)