from flask.views import MethodView
from flask_helpers.build_response import build_response
from flask_helpers.ErrorHandler import ErrorHandler
from python_cowbull_game.GameObject import GameObject


class GameModes(MethodView):
    def get(self):
        digits = GameObject.digits_used
        guesses = GameObject.guesses_allowed
        game_modes = [mode for mode in GameObject.digits_used]

        return_list = []
        for mode in game_modes:
            return_list.append(
                {
                    "mode": mode,
                    "digits": digits[mode],
                    "guesses": guesses[mode]
                }
            )

        return build_response(
            html_status=200,
            response_data=return_list,
            response_mimetype="application/json"
        )

@@ -1,16 +1,42 @@
+from flask import request%0A
 from flask.views
@@ -54,16 +54,16 @@
 hodView%0A
-
 from fla
@@ -266,16 +266,280 @@
 (self):%0A
+        textonly = request.args.get('textmode', None)%0A        if textonly:%0A            return build_response(%0A                html_status=200,%0A                response_data=GameObject.game_modes,%0A                response_mimetype=%22application/json%22%0A            )%0A%0A
         
@@ -615,16 +615,60 @@
 allowed%0A
+        game_modes = GameObject.game_modes%0A#
         

Add text only mode to get game modes