squirrel-battle/squirrelbattle/bootstrap.py

25 lines
778 B
Python
Raw Permalink Normal View History

2021-01-10 09:46:17 +00:00
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
2020-11-27 15:33:17 +00:00
# SPDX-License-Identifier: GPL-3.0-or-later
2021-01-10 10:25:53 +00:00
from .display.display_manager import DisplayManager
from .game import Game
from .term_manager import TermManager
2020-11-10 19:34:22 +00:00
class Bootstrap:
"""
2020-11-18 13:56:59 +00:00
The bootstrap object is used to bootstrap the game so that it starts
properly.
(It was initially created to avoid circular imports between the Game and
Display classes)
"""
@staticmethod
def run_game():
with TermManager() as term_manager: # pragma: no cover
game = Game()
game.new_game()
display = DisplayManager(term_manager.screen, game)
2020-11-12 00:57:56 +00:00
game.display_actions = display.handle_display_action
2020-11-10 19:34:22 +00:00
game.run(term_manager.screen)