ArrayList<DBVehicleEvent> vehicleEvents = new ArrayList<DBVehicleEvent>();
ArrayList<Takeoff> takeoffEvents = mission.getTakeoffs();
ArrayList<Landing> landingEvents = mission.getLandings();
Takeoff takeoff;
Landing landing;
float[] tmpPos;
Iterator<Takeoff> tit = takeoffEvents.iterator();
while (tit.hasNext())
{
takeoff = tit.next();
tmpPos = takeoff.getPosition();
//add takeoff to events
DBVehicleEvent tmpTakeoff = new DBVehicleEvent(takeoff.getPlaneID(),
mission.getMissionID(), takeoff.getTick(),
"takeoff", tmpPos[0], tmpPos[1], tmpPos[2]);
vehicleEvents.add(tmpTakeoff);
}
Iterator<Landing> lit = landingEvents.iterator();
while (lit.hasNext())
{
landing = lit.next();
tmpPos = landing.getPosition();
//add landing to events
DBVehicleEvent tmpLanding = new DBVehicleEvent(landing.getPlaneID(),
mission.getMissionID(), landing.getTick(),
"landing", tmpPos[0], tmpPos[1], tmpPos[2]);
vehicleEvents.add(tmpLanding);
}
return vehicleEvents;