Example #1
0
class PlaceArmiesCmd(OutputCommand):
    """Parameter string: Space separated list of bot name, the string place_armies, region, number of armies"""
    pattern = "(\w+) place_armies (\d+) (\d+)"

    def __init__(self, line):
        match = re.search(PlaceArmiesCmd.pattern, line)
        self.__placedArmies = Deployment(match.group(1), match.group(2), int(match.group(3)))

    def placed_armies(self):
        return self.__placedArmies

    def output(self):
        return self.__placedArmies.output()
Example #2
0
 def __init__(self, line):
     match = re.search(PlaceArmiesCmd.pattern, line)
     self.__placedArmies = Deployment(match.group(1), match.group(2), int(match.group(3)))