def connect(agent, status):

            grid: Grid
            if self.typegame == 1:
                grid = Grid.grid_by_ten()
            else:
                grid = Grid.grid_by_twenty()
            if self.is_alone:
                self.is_alone = False
                if status == StateOnline.JOIN.name and self.state_online == StateOnline.CREATE:
                    # create grid voir avec Cyril
                    # On evoie la grille
                    self.agent.send_msg(
                        f'grid={grid.__str__()}time={self.time.__str__()}')
                    # time={self.time.__str__()}
                    self.change_to_game(grid)
                elif status == StateOnline.CREATE.name and self.state_online == StateOnline.JOIN:
                    self.agent.send_msg(f'connect={StateOnline.JOIN.name}')
    def runGame(self):

        if self.var.get() == 2:
            self.start_to_game(Grid.grid_by_twenty())
        else:
            self.start_to_game(Grid.grid_by_ten())
Example #3
0
 def gride_creator(self, val: int):
     return Grid.grid_by_ten() if val == 1 else Grid.grid_by_twenty()