import random class CommonFunctions: def __eq__(self, other): return True def __init__(self): self.random_group = random.randint(1, 2) self.context_sequence_group = random.sample([i for i in range(1, 31)], 15) self.action_sequence_group = [random.sample([i for i in range(1, 5)], 4) for i in range(0, 15)] def getContextImagesGroup(self, round_number): return self.context_sequence_group[round_number-1] def getActionImagesGroup(self, round_number): return self.action_sequence_group[round_number-1] def getContextImagesPath(self, round_number): context_images_group = self.getContextImagesGroup(round_number) return [f'Image/{self.random_group}Env{context_images_group}{i}.png' for i in range(1, 5)] def getActionImagesPath(self, round_number): action_images_group = self.getActionImagesGroup(round_number) return [f'Image/0Action{i}.png' for i in action_images_group] def getTickCrossImage(self, player): return 'Image/tick.png' if player.check_action_choice == 1 else 'Image/cross.png'