repository to manage all files for 1_2_oder_3 interaction game for Inf2/2 Interaktionen SoSe23 from Engert, Caliskan and Bachiri
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

game.py 972B

12345678910111213141516171819202122232425262728293031323334
  1. from Database.database import QuestionDataBase
  2. class Game:
  3. def __init__(self, teamsize=0):
  4. self.teamsize = teamsize
  5. self.scoreboard = {'score_red': 0,
  6. 'score_blue': 0,
  7. 'score_yellow': 0}
  8. self.questions = QuestionDataBase('src_folder/BackEnd/Database/EinsZweiOderDrei.db')
  9. self.available_questions = list(range(1, self.questions.num_rows()))
  10. def set_teamsize(self, teamsize: int):
  11. self.teamsize = teamsize
  12. def add_score(self, current_score: dict):
  13. for key in self.scoreboard.keys():
  14. if key in current_score.keys():
  15. self.scoreboard[key] = self.scoreboard[key] + current_score[key]
  16. else:
  17. pass
  18. return self.scoreboard
  19. def random_question():
  20. pass
  21. ## ToDo: select question and remove selected question from list
  22. def reset_game(self):
  23. self.__init__()