thiiiiings

This commit is contained in:
Jonas Zeunert
2020-02-13 19:05:55 +01:00
parent 82f1ad6ed8
commit 7414734dad
719 changed files with 41551 additions and 227 deletions

23
Game.py Normal file
View File

@@ -0,0 +1,23 @@
import asyncio
import signal
class Game:
def __init__(self, input_handler, player_state, game_state):
self.input_handler = input_handler
self.player_state = player_state
self.game_state = game_state
signal.signal(signal.SIGINT, self.interrupt)
self.is_running = asyncio.Condition()
pass
def interrupt(self):
print('Received SIGINT. Stopping Game :-)')
self.is_running.release()
def run(self):
self.is_running.acquire()
asyncio.run(self.input_handler.handleInputs())
await self.is_running.wait()
pass