MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / serialize_round

Function serialize_round

scripts/tournament_serialize.py:128–144  ·  view source on GitHub ↗

Returns the deserialized version of a single round.

(cur, round_num: int)

Source from the content-addressed store, hash-verified

126 return match
127
128def serialize_round(cur, round_num: int):
129 '''
130 Returns the deserialized version of a single round.
131 '''
132 t_round = {}
133 t_round['round'] = round_num
134 t_round['matches'] = []
135
136 cur.execute('SELECT MAX(index) FROM {} WHERE round=%s;'.format(TABLE_NAME), (round_num,))
137 max_index = cur.fetchone()[0]
138 for index in range(0, max_index + 1):
139 match = serialize_match(cur, round_num, index)
140 if match is None:
141 continue
142 t_round['matches'].append(match)
143
144 return t_round
145
146
147def serialize_tournament(cur):

Callers 1

serialize_tournamentFunction · 0.85

Calls 2

serialize_matchFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected