Пример #1
0
def setDataForMatch(match):
    m = DataModel.Match()
    f = lambda key: [
        match["alliances"]["red"][key], match["alliances"]["blue"][key]
    ]
    m.number, m.redAllianceTeamNumbers, m.blueAllianceTeamNumbers = int(
        match["match_number"]), f("teams")[0], f("teams")[1]
    m.redScore, m.blueScore, m.TIMDs = 0, 0, []
    return m
Пример #2
0
def setDataForMatch(match):
    m = DataModel.Match()
    m.number, m.redAllianceTeamNumbers, m.blueAllianceTeamNumbers = int(
        match['match_number']), match['alliances']['red']['team_keys'], match[
            'alliances']['blue']['team_keys']
    return m
Пример #3
0
def makeMatchFromDict(d):
    match = DataModel.Match(**d)
    if 'calculatedData' in d.keys():
        match.calculatedData = DataModel.CalculatedMatchData(
            **d['calculatedData'])
    return match
Пример #4
0
def makeMatchFromDict(d):
    match = DataModel.Match(**d)  #I have no idea why this works
    if 'calculatedData' in d.keys():
        match.calculatedData = DataModel.CalculatedMatchData(
            **d['calculatedData'])
    return match