|
@@ -5,6 +5,9 @@ import lib
|
|
|
|
|
|
game = Blueprint("game", __name__)
|
|
|
|
|
|
+rsv_gen = lib.random_street_view_generator(only_america=False)
|
|
|
+rsv_gen_usa = lib.random_street_view_generator(only_america=True)
|
|
|
+
|
|
|
|
|
|
def require_game(game_id):
|
|
|
g = db.Game.query.get(game_id)
|
|
@@ -52,13 +55,15 @@ def create_game():
|
|
|
coords = []
|
|
|
|
|
|
if gen_method == "MAPCRUNCH":
|
|
|
- for round_num in range(rounds):
|
|
|
+ for _ in range(rounds):
|
|
|
maybe_coord = lib.generate_coord(only_america=only_america)
|
|
|
while maybe_coord is None:
|
|
|
maybe_coord = lib.generate_coord(only_america=only_america)
|
|
|
coords.append(maybe_coord)
|
|
|
elif gen_method == "RANDOMSTREETVIEW":
|
|
|
- abort(400) # TODO
|
|
|
+ gen = rsv_gen_usa if only_america else rsv_gen
|
|
|
+ for _ in range(rounds):
|
|
|
+ coords.append(next(gen))
|
|
|
else:
|
|
|
abort(400)
|
|
|
|