Пример #1
0
def genHabitablePlanet(system,
                       orbit,
                       radius,
                       name,
                       angle,
                       angleSpeed,
                       style,
                       population,
                       race,
                       invader=None,
                       relation=None):
    planet = HabitablePlanet()
    planet.orbit = orbit
    planet.radius = radius
    planet.name = name
    planet.angle = angle
    planet.angleSpeed = angleSpeed
    planet.style = style
    if invader:
        planet.invader = invader
    planet.population = population

    context = LandContext()
    world.addObject(context)
    context.race = textHash32(race.id)
    if relation:
        planet.landContext().relation = relation

    planet.landContext = context

    world.addObject(planet)
    system.addObject(planet)

    return planet
Пример #2
0
def loadBackgrounds():
    bgs = ['00', '01', '02', '03', '04', \
           '05', '06', '07', '08', '09', \
           '10', '11', '12', '13', '14', \
           '15', '50', '51', '52', '53', \
           '54', '55', '70', '71']    
    for b in bgs:
        id = 'bg' + b
        world.styleManager().addSystemBackground(textHash32(id), 'DATA/BGObj/' + id + '.gai')
Пример #3
0
def loadBackgrounds():
    bgs = ['00', '01', '02', '03', '04', \
           '05', '06', '07', '08', '09', \
           '10', '11', '12', '13', '14', \
           '15', '50', '51', '52', '53', \
           '54', '55', '70', '71']
    for b in bgs:
        id = 'bg' + b
        world.styleManager().addSystemBackground(textHash32(id),
                                                 'DATA/BGObj/' + id + '.gai')
Пример #4
0
def genHabitablePlanet(system, orbit, radius, name, angle, angleSpeed, style, population, race, invader = None, relation = None):
    planet = HabitablePlanet()
    planet.orbit = orbit
    planet.radius = radius
    planet.name = name
    planet.angle = angle
    planet.angleSpeed = angleSpeed
    planet.style = style
    if invader:
        planet.invader = invader
    planet.population = population
    
    context = LandContext()
    world.addObject(context)
    context.race = textHash32(race.id)
    if relation:
        planet.landContext().relation = relation

    planet.landContext = context
    
    world.addObject(planet)
    system.addObject(planet)
    
    return planet