diff --git a/controller.py b/controller.py index e69de29..fc05d62 100644 --- a/controller.py +++ b/controller.py @@ -0,0 +1,25 @@ +#from view import GameView +import sys + +class Controller: + """Class that handles everything for the module""" + + def __init__(self): + pass + + def get_menu_choice(self): + """Gets input from user and processes the input""" + selection = input('Please enter the number that corresponds to your desired menu: ') + if selection == '1': + print('1') + elif selection == '2': + print('2') + elif selection == '3': + print('3') + elif selection == '4': + #GameView.clear_console() + sys.exit() + else: + print('Your choice is not valid! Please try again!') + self.get_menu_choice() + diff --git a/main.py b/main.py index e69de29..209524d 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,5 @@ +from view import GameView + +if __name__ == "__main__": + game_view = GameView() + game_view.print_menu() \ No newline at end of file diff --git a/view.py b/view.py index 97dc7b2..3564ccc 100644 --- a/view.py +++ b/view.py @@ -1,13 +1,13 @@ +import os +from controller import Controller + class GameView: def __init__(self): - pass - + self.controller = Controller() @staticmethod def display_message(message): - # Display a message to the user - pass """ Display a message to the user. """ @@ -20,8 +20,18 @@ def get_user_input(prompt): """ return input(prompt) + @staticmethod + def clear_console(): + """ + Clear the console of unnecessary stuff + """ + if os.name in ['nt', 'dos']: + command = 'cls' + else: + command = 'clear' + os.system(command) + def print_menu(self): - self.clear_console() print(""" ██████╗██╗ ██╗███████╗███████╗███████╗ ██╔════╝██║ ██║██╔════╝██╔════╝██╔════╝ @@ -35,4 +45,5 @@ def print_menu(self): 1) New Game 2) Load Game 3) Exit -""") \ No newline at end of file +""") + self.controller.get_menu_choice() \ No newline at end of file