예제 #1
0
 def get_waypoints(self):
     """Adds possible starting points to the list."""
     waypoints = super(PassengersContract, self).get_waypoints()
     if self.from_loc.aircraft_launch:
         self.waypoints.append(self.from_loc.aircraft_launch)
         waypoints.extend([[
             ('name', self.from_loc.name + ' runway'),
             ('icon', ICONS_PATH + 'Runway'),
         ] + utils.point_to_params(self.from_loc.aircraft_launch)])
     if self.from_loc.helipad:
         self.waypoints.append(self.from_loc.helipad)
         waypoints.extend([[
             ('name', self.from_loc.name + ' helipad'),
             ('icon', ICONS_PATH + 'Helipad'),
         ] + utils.point_to_params(self.from_loc.helipad)])
     return waypoints
예제 #2
0
 def get_waypoints(self):
     """Adds possible starting points to the list."""
     waypoints = super(PassengersContract, self).get_waypoints()
     if self.from_loc.runway:
         self.waypoints.append(self.from_loc.runway)
         waypoints += [[
                 ('name', self.from_loc.name + ' runway'),
                 ('icon', ICONS_PATH + 'Runway'),
             ] + utils.point_to_params(self.from_loc.runway)
         ]
     if self.from_loc.helipad:
         self.waypoints.append(self.from_loc.helipad)
         waypoints += [[
                 ('name', self.from_loc.name + ' helipad'),
                 ('icon', ICONS_PATH + 'Helipad'),
             ] + utils.point_to_params(self.from_loc.helipad)
         ]
     return waypoints
예제 #3
0
 def get_waypoints(self):
     """
     Returns the list of points for waypoint generator behavior. By default
     gives parking points of destination location.
     """
     waypoints = []
     if self.to_loc.aircraft_parking:
         self.waypoints.append(self.to_loc.aircraft_parking)
         waypoints.extend([[
             ('name', self.to_loc.name + ' aircraft parking'),
             ('icon', ICONS_PATH + 'Parking'),
         ] + utils.point_to_params(self.to_loc.aircraft_parking)])
     if self.to_loc.helipad:
         self.waypoints.append(self.to_loc.helipad)
         waypoints.extend([[
             ('name', self.to_loc.name + ' helipad'),
             ('icon', ICONS_PATH + 'Helipad'),
         ] + utils.point_to_params(self.to_loc.helipad)])
     return waypoints
예제 #4
0
 def get_waypoints(self):
     """
     Returns the list of points for waypoint generator behavior. By default
     gives parking points of destination location.
     """
     waypoints = []
     if self.to_loc.aircraft_parking:
         self.waypoints.append(self.to_loc.aircraft_parking)
         waypoints += [[
                 ('name', self.to_loc.name + ' aircraft parking'),
                 ('icon', ICONS_PATH + 'Parking'),
             ] + utils.point_to_params(self.to_loc.aircraft_parking)
         ]
     if self.to_loc.helipad:
         self.waypoints.append(self.to_loc.helipad)
         waypoints += [[
                 ('name', self.to_loc.name + ' helipad'),
                 ('icon', ICONS_PATH + 'Helipad'),
             ] + utils.point_to_params(self.to_loc.helipad)
         ]
     return waypoints
예제 #5
0
 def get_waypoints(self):
     """Adds random waypoints for staff."""
     waypoints = super(ServiceFlightContract, self).get_waypoints()
     self.staff_points_start_index = len(waypoints)
     waypoints += [
         [
             ('name', 'Staff spawn point'),
             ('hidden', 'true'),
         ] + utils.point_to_params(self.from_loc.staff_spawn),
         [
             ('hidden', 'true'),
             ('nearIndex', self.staff_points_start_index),
             ('altitude', self.from_loc.staff_spawn[2]),
             ('count', self.passengers_number),
             ('minDistance', 1),
             ('maxDistance', 2),
         ],
     ]
     self.staff_points_start_index += 1 # skip staff spawn point itself
     return waypoints
예제 #6
0
 def get_waypoints(self):
     """Adds random waypoints for staff."""
     waypoints = super(ServiceFlightContract, self).get_waypoints()
     self.staff_points_start_index = len(waypoints)
     waypoints.extend([
         [
             ('name', 'Staff spawn point'),
             ('hidden', 'true'),
         ] + utils.point_to_params(self.from_loc.staff_spawn, absolute_altitude=True),
         [
             ('hidden', 'true'),
             ('nearIndex', self.staff_points_start_index),
             ('altitude', self.from_loc.staff_spawn[2].absolute),
             ('count', self.passengers_number),
             ('minDistance', 1),
             ('maxDistance', 2),
         ],
     ])
     self.staff_points_start_index += 1 # skip staff spawn point itself
     return waypoints
예제 #7
0
def make_locations_waypoints(options):
    """Makes .cfg file with all waypoints in WaypointManager format."""
    print 'Waypoints for locations are generating'
    waypoints = []
    index = 0
    for loc in LOCATIONS:
        for point_type in ('helipad', 'aircraft_launch', 'aircraft_parking', 'staff_spawn', 'vip_spawn'):
            point = getattr(loc, point_type)
            if point is None or (point_type == 'aircraft_parking' and point == loc.aircraft_launch):
                continue
            index += 1
            waypoints.append(('WAYPOINT', [
                    ('name', '{} > {}'.format(loc.name, point_type)),
                    ('celestialName', 'Kerbin'),
                    ('icon', 'report'),
                    ('index', index),
                ] + utils.point_to_params(point)
            ))
    if options.verbose > 1:
        print 'Writing file CustomWaypoints.cfg'
    with open('CustomWaypoints.cfg', 'w') as out:
        utils.write_config(out, waypoints)
예제 #8
0
def make_locations_waypoints(options):
    """Makes .cfg file with all waypoints in WaypointManager format."""
    print 'Waypoints for locations are generating'
    waypoints = []
    index = 0
    for loc in LOCATIONS:
        for point_type in ('runway', 'helipad', 'aircraft_parking',
                           'staff_spawn', 'vip_spawn'):
            point = getattr(loc, point_type)
            if point is None or (point_type == 'aircraft_parking'
                                 and point == loc.runway):
                continue
            index += 1
            waypoints.append(('WAYPOINT', [
                ('name', '{} > {}'.format(loc.name, point_type)),
                ('celestialName', 'Kerbin'),
                ('icon', 'report'),
                ('index', index),
            ] + utils.point_to_params(point)))
    if options.verbose > 1:
        print 'Writing file CustomWaypoints.cfg'
    with open('CustomWaypoints.cfg', 'w') as out:
        utils.write_config(out, waypoints)