12345678910111213141516171819202122232425262728293031323334 |
- from Database.database import QuestionDataBase
-
-
- class Game:
- def __init__(self, teamsize=0):
- self.teamsize = teamsize
- self.scoreboard = {'score_red': 0,
- 'score_blue': 0,
- 'score_yellow': 0}
-
- self.questions = QuestionDataBase('src_folder/BackEnd/Database/EinsZweiOderDrei.db')
- self.available_questions = list(range(1, self.questions.num_rows()))
-
- def set_teamsize(self, teamsize: int):
- self.teamsize = teamsize
-
- def add_score(self, current_score: dict):
- for key in self.scoreboard.keys():
- if key in current_score.keys():
- self.scoreboard[key] = self.scoreboard[key] + current_score[key]
- else:
- pass
- return self.scoreboard
-
- def random_question():
- pass
- ## ToDo: select question and remove selected question from list
-
- def reset_game(self):
- self.__init__()
-
-
-
|