From c9b24edd8e36bc6b1e2217c5eeeffcdc82cf05f3 Mon Sep 17 00:00:00 2001 From: RomulAugustus <87079566+RomulAugustus@users.noreply.github.com> Date: Mon, 25 Jul 2022 17:46:45 +0300 Subject: [PATCH] fleshed out GameLogic a bit * added time counting stub * added score counting stub * added win check stub * made it so you pass gameMap to the logic * you pass the list of players too (both gameMap and playerList are assumed to be made outside when configuring the game) * --- GameLogic.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/GameLogic.py b/GameLogic.py index 77b2805..853c095 100644 --- a/GameLogic.py +++ b/GameLogic.py @@ -1,2 +1,35 @@ +from GameMap import * +from Player import * + class GameLogic(): - pass \ No newline at end of file + + def __init__(self, gameMap, playerList, winRowLength, individualMoves): + + self.gameMap = gameMap + self.playerList = playerList + self.winRowLength = winRowLength + self.individualMoves = individualMoves + self.time = 0 # in seconds + self.score = 0 + + self.wait_for_input() + + + def wait_for_input(self): + pass + + + def check_for_win(self, playerList): + for player in playerList: + pass + + def get_time(self): + return self.time + + + def reset_time(self): + self.time = 0 + + + def get_score(self): + return self.score \ No newline at end of file