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

Function get_tournament_maps

scripts/tournament_single_elim.py:64–80  ·  view source on GitHub ↗

Returns a list of potential map names with the given tag.

(conn, tag=None)

Source from the content-addressed store, hash-verified

62
63
64def get_tournament_maps(conn, tag=None) -> List[Map]:
65 """
66 Returns a list of potential map names with the given tag.
67 """
68 cur = conn.cursor()
69
70 if tag is not None:
71 filter_query = 'WHERE tag=\'{}\''.format(tag)
72 else:
73 filter_query = ''
74
75 query = 'SELECT name FROM scrimmage_maps {} ORDER BY id;'.format(filter_query)
76 cur.execute(query)
77 maps = cur.fetchall()
78 cur.close()
79
80 return list(map(lambda x: x[0], maps))
81
82
83def get_all_teams_and_index_submissions(conn) -> List[Team]:

Callers 1

runFunction · 0.85

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected