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

Function queue_round

scripts/tournament_single_elim.py:273–285  ·  view source on GitHub ↗
(conn, round_num, maps)

Source from the content-addressed store, hash-verified

271
272
273def queue_round(conn, round_num, maps):
274 assert len(maps) == NUM_MAPS_PER_GAME
275 cur = conn.cursor()
276 cur.execute('SELECT COUNT(*) FROM {} WHERE round=%s;'.format(TABLE_NAME),
277 (round_num - 1,))
278 max_index = int(cur.fetchone()[0] / 3 / 2)
279
280 for index in range(max_index):
281 red = get_next_team_and_from(conn, round_num, index, COLOR_RED)
282 blue = get_next_team_and_from(conn, round_num, index, COLOR_BLUE)
283 queue_match(conn, round_num, index, red, blue, maps)
284 conn.commit()
285 cur.close()
286
287
288def queue_initial_round(conn, teams, maps):

Callers 1

run_tournamentFunction · 0.85

Calls 3

get_next_team_and_fromFunction · 0.85
queue_matchFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected