def __init__(self, name): super(InplaySwitch, self).__init__(name) INPLAY_DEFEND = ParallelOne("PARALLEL_DEFEND") INPLAY_DEFEND.add_child(Analyst.BallMoved("Ball moved")) EXE_SELECTOR = Selector("EXE_SELECTOR") ONE_ROBOT = ParallelAll("ONE_ROBOT") ONE_ROBOT.add_child(Analyst.ThereIsOnlyOneRobot("ThereIsOneRobot")) ONE_ROBOT.add_child(Attacker.StopGame("AttackerStop", 0)) EXE_SELECTOR.add_child(ONE_ROBOT) SOME_ROBOTS = ParallelAll("SOME_ROBOTS") SOME_ROBOTS.add_child(Analyst.ThereAreRobots("ThereAreRobots")) SOME_ROBOTS.add_child(GoalKeeper.Defense("GoalKeeperDefense",0)) # SOME_ROBOTS.add_child(Attacker.StopGame("AttackerStop", 1)) SOME_ROBOTS.add_child(Attacker.ChipKickGuard("ChipKickGuard", 1)) SOME_ROBOTS.add_child(Defender.Defense("DefenderDefense", 2)) EXE_SELECTOR.add_child(SOME_ROBOTS) INPLAY_DEFEND.add_child(EXE_SELECTOR) INPLAY = InPlay.Execute("Execute inplay") self.add_child(INPLAY_DEFEND) self.add_child(INPLAY)
def __init__(self, name): super(Prepare, self).__init__(name) EXE_SELECTOR = Selector("EXE_SELECTOR") ONE_ROBOT = ParallelAll("ONE_ROBOT") ONE_ROBOT.add_child(Analyst.ThereIsOnlyOneRobot("ThereIsOneRobot")) ONE_ROBOT.add_child(Attacker.StopGame("AttackerStop", 0)) EXE_SELECTOR.add_child(ONE_ROBOT) SOME_ROBOTS = ParallelAll("SOME_ROBOTS") SOME_ROBOTS.add_child(Analyst.ThereAreRobots("ThereAreRobots")) SOME_ROBOTS.add_child(GoalKeeper.Defense("GoalKeeperDefense", 0)) # SOME_ROBOTS.add_child(Attacker.StopGame("AttackerStop", 1)) SOME_ROBOTS.add_child(Attacker.ChipKickGuard("ChipKickGuard", 1)) SOME_ROBOTS.add_child(Defender.SetplayDefense("DefenderDefense", 2)) EXE_SELECTOR.add_child(SOME_ROBOTS) self.add_child(IsKICKOFF_ENEMY("IsKICKOFF_ENEMY")) self.add_child(EXE_SELECTOR)