class PreQualGlobalTask(Task):
    """
    Task to complete prequalifying run by moving to global poses
    """

    POSE1 = [0, 0, 0, 0, 0, 0]
    POSE2 = [0, 0, 0, 0, 0, 0]
    POSE3 = [0, 0, 0, 0, 0, 0]
    POSE4 = [0, 0, 0, 0, 0, 0]
    POSE5 = [0, 0, 0, 0, 0, 0]

    def __init__(self):
        super(PreQualGlobalTask, self).__init__()

        self.list_task = ListTask([
            MoveToPoseGlobalTask(*self.POSE1),
            MoveToPoseGlobalTask(*self.POSE2),
            MoveToPoseGlobalTask(*self.POSE3),
            MoveToPoseGlobalTask(*self.POSE4),
            MoveToPoseGlobalTask(*self.POSE5)
        ])

    def _on_task_run(self):
        self.list_task.run()

        if self.list_task.finished:
            self.finish()
class CompetitionTask(Task):
    """
    High level competition level task, contains a list of tasks for each competition task.
    """
    def __init__(self, *args, **kwargs):
        super(CompetitionTask, self).__init__(*args, **kwargs)

        self.list_task = ListTask([MoveToPoseGlobalTask(-7, 0, 0, 0, 0, 0)])

    def _on_task_run(self):
        self.list_task.run()

        if self.list_task.finished:
            self.finish()