def convertScript(self, script):
        """

        @param script:
        @return:
        """
        lijst = script.split(',')

        eventList = [(0, event.start())]
        for eventStr in lijst:
            events = self.parseEventStr(eventStr)
            eventList.extend(events)

        #Replace the last phase ends with mission ends
        lastEvent = eventList[-1][1]
        if isinstance(lastEvent,event.phaseEnds):
            lastPhaseNumber = lastEvent.getPhaseNumber()
            for time, eventItem in eventList:
                if isinstance(eventItem, event.phaseEnds):
                    if eventItem.getPhaseNumber() == lastPhaseNumber:
                        eventItem.convertToEndMission()

        else:
            print 'ERROR, the last event is not a phase end!'


        return eventList
Example #2
0
def events():
    eventsInit()
    event.start(60)