示例#1
0
 def get_loc(self, timeout=0):
     check = wait(self._check_to_location.keys(),
                  timeout=timeout,
                  trace_frame=1)
     if not check:
         return None
     return self._check_to_location[check]
示例#2
0
文件: arena.py 项目: aachurin/robobo
def get_arena_state(*args, **kwargs):
    return wait((
        "arena/game/active",
        "arena/game/finished",
        "arena/game/waiting_next",
        "arena/game/waiting_finish",
        "arena/game/victory",
        "arena/game/defeat"
    ), *args, trace_frame=1, **kwargs)
示例#3
0
文件: arena.py 项目: aachurin/robobo
def get_current_stage15(*args, **kwargs):
    stage = wait((
        "arena/game/stage15_1",
        "arena/game/stage15_2",
        "arena/game/stage15_3",
        "arena/game/stage15_4",
        "arena/game/stage15_5",
    ), *args, trace_frame=1, **kwargs)
    return {
        "arena/game/stage15_1": 1,
        "arena/game/stage15_2": 2,
        "arena/game/stage15_3": 3,
        "arena/game/stage15_4": 4,
        "arena/game/stage15_5": 5
    }.get(stage)
示例#4
0
 def transition():
     logger.info("go to %r", to_loc)
     if action():
         wait(self._location_check[to_loc], trace_frame=1)