Example #1
0
func (self *AircraftTest) testFlightLoop(elapsedSinceLastCall, elapsedTimeSinceLastFlightLoop float32, counter int, ref interface{}) float32 {
	if self.currentTestPlaneId > 0 {
		self.multiplayerManager.DestroyPlane(self.currentTestPlaneId)
	}
	if self.currentIndex >= len(self.allAircrafts) {
		processing.UnregisterFlightLoopCallback(self.testFlightLoop, nil)
		self.multiplayerManager.GetConfiguration().CalculationMod = self.oldConfigMod
		return 0
	}
	currentAircraft := self.allAircrafts[self.currentIndex]
	logging.Debugf("testing Plane: index=%v/%v icao=%v airline=%v livery=%v", self.currentIndex, len(self.allAircrafts), currentAircraft.Icao, currentAircraft.Airline, currentAircraft.Livery)
	self.currentTestPlaneId = self.multiplayerManager.CreatePlane(currentAircraft.Icao, currentAircraft.Airline, currentAircraft.Livery, self.testDataFunc, currentAircraft)
	self.currentIndex += 1
	return 0.125

}
Example #2
0
func (self *TaskManager) Stop() {
	processing.UnregisterFlightLoopCallback(self.processTaskLoop, nil)
}