def __init__(self, s): m = regex.match(s) if m == None: print('Error invalid Message: #' + s + '#') return self.dest_x = int(m.group(1)) self.dest_y = int(m.group(2)) self.self_x = int(m.group(3)) self.self_y = int(m.group(4)) self.self_direction = Direction.from_str(m.group(5)) self.team = m.group(6) self.message = m.group(7)