예제 #1
0
 def __init__(self, nb_players=None, max_steps=settings.MAX_GAME_STEPS, retour=True,verbose=True):
     self.nb_players, self.max_steps, self._retour = nb_players, max_steps, retour
     self._matches = dict()
     self._teams = []
     self._listeners = SoccerEvents()
     self.cur_match, self._list_matches = None, None
     self._over, self._on_going = False, False
     self.cur_i, self.cur_j = -1, -1
     self.verbose = verbose
     self._kill = False
     self._replay = False
     self._join = True
예제 #2
0
 def __init__(self, team1=None, team2=None, max_steps=settings.MAX_GAME_STEPS, states = None):
     """
     :param team1: premiere equipe
     :param team2: deuxieme equipe
     :return:
     """
     self._team1, self._team2, self.max_steps = team1, team2, max_steps
     self._listeners = SoccerEvents()
     self._state = None  # SoccerState.create_initial_state(self._team1.nb_players,self._team2.nb_players)
     self._thread = None
     self._on_going = False
     self._lock = Lock()
     self._kill = False
     self._replay = False
     self._step_replay = 0
     self._states = []  # [self.state]
     if states:
         self.states = states