Exemple #1
0
    def __init__(self):
        print "New game instance initializing..."
        # Instantiate the body database with the moons adjusted by DAYS_PER_SEC*2 deviated from zero
        self.bodies = BodyDB(DAYS_PER_SEC*2).getBodies()
        # self.OOIs = OOIs()
        # TODO: Replace this with MPO data
        self.NEOs = list()
        for asteroid in asteroidDB.getAsteroidSurvey(SurveyTypes.neo):
            self.NEOs.append(self.cleanAsteroidObject(asteroid))

        self.mainBelt = list()
        for asteroid in asteroidDB.getAsteroidSurvey(SurveyTypes.main_belt):
            self.mainBelt.append(self.cleanAsteroidObject(asteroid))

        self.kuiperBelt = list()
        for asteroid in asteroidDB.getAsteroidSurvey(SurveyTypes.kuiper_belt):
            self.kuiperBelt.append(self.cleanAsteroidObject(asteroid))

        self.OOIs = self.NEOs + self.mainBelt + self.kuiperBelt
        self.id = uuid.uuid4()
        self.players = list()
        self.playerObjects = list()
        self.eventList = getMockEventList()
        self._epoch = int(rTime())  # real-time game start

        probe2 = {
            'ma': -2.47311027,
            'epoch': 2451545.0,
            'a': 1.00000261,
            'e': 0.02671123,
            'i': 0.00001531,
            'w_bar': 102.93768193,
            'w': 102.93768193,
            'L': 100.46457166,
            'om': 0,
            'P': 365.256
        }
        self.addPlayerObject("Probe", "Magellan", probe2, "PyKEP_test")

        self.colors = list()
        self.colors.append({'player': None, 'color': '0xff0000'})
        self.colors.append({'player': None, 'color': '0x00ff00'})
        self.colors.append({'player': None, 'color': '0x0000ff'})
        self.colors.append({'player': None, 'color': '0xffff00'})
        self.colors.append({'player': None, 'color': '0xff00ff'})

        self.date = datetime.date(START_YEAR, 4, 1)

        timer = Timer(1.0, self.timeSync)
        timer.daemon = True
        timer.start()
Exemple #2
0
    def __init__(self):
        print "New game instance initializing..."
        # Instantiate the body database with the moons adjusted by DAYS_PER_SEC*2 deviated from zero
        self.bodies = BodyDB(DAYS_PER_SEC*2).getBodies()
        # self.OOIs = OOIs()
        # TODO: Replace this with MPO data
        self.NEOs = list()
        for asteroid in asteroidDB.getAsteroidSurvey('NEO'):
            self.NEOs.append(self.cleanAsteroidObject(asteroid))

        self.mainBelt = list()
        for asteroid in asteroidDB.getAsteroidSurvey('MainBelt'):
            self.mainBelt.append(self.cleanAsteroidObject(asteroid))

        self.kuiperBelt = list()
        for asteroid in asteroidDB.getAsteroidSurvey('KuiperBelt'):
            self.kuiperBelt.append(self.cleanAsteroidObject(asteroid))

        self.OOIs = self.NEOs + self.mainBelt + self.kuiperBelt
        self.id = uuid.uuid4()
        self.players = list()
        self.playerObjects = list()
        self.eventList = getMockEventList()
        self._epoch = int(rTime())  # real-time game start

        probe2 = {
            'ma': -2.47311027,
            'epoch': 2451545.0,
            'a': 1.00000261,
            'e': 0.02671123,
            'i': 0.00001531,
            'w_bar': 102.93768193,
            'w': 102.93768193,
            'L': 100.46457166,
            'om': 0,
            'P': 365.256
        }
        self.addPlayerObject("Probe", "Magellan", probe2, "PyKEP_test")

        self.colors = list()
        self.colors.append({'player': None, 'color': '0xff0000'})
        self.colors.append({'player': None, 'color': '0x00ff00'})
        self.colors.append({'player': None, 'color': '0x0000ff'})
        self.colors.append({'player': None, 'color': '0xffff00'})
        self.colors.append({'player': None, 'color': '0xff00ff'})

        self.date = datetime.date(START_YEAR, 4, 1)

        timer = Timer(1.0, self.timeSync)
        timer.daemon = True
        timer.start()
Exemple #3
0
    def __init__(self):
        print "New game instance initializing..."
        # self.OOIs = OOIs()
        # TODO: Replace this with MPO data
        self.NEOs = list()
        for asteroid in asteroidDB.getAsteroidSurvey('NEO'):
            self.NEOs.append(self.cleanAsteroidObject(asteroid))

        self.mainBelt = list()
        for asteroid in asteroidDB.getAsteroidSurvey('MainBelt'):
            self.mainBelt.append(self.cleanAsteroidObject(asteroid))

        self.kuiperBelt = list()
        for asteroid in asteroidDB.getAsteroidSurvey('KuiperBelt'):
            self.kuiperBelt.append(self.cleanAsteroidObject(asteroid))

        self.OOIs = self.NEOs + self.mainBelt + self.kuiperBelt
        self.id = uuid.uuid4()
        self.players = list()
        self.playerObjects = list()
        self.eventList = getMockEventList()
        self._epoch = int(time())  # real-time game start
        ephemeris = {
            'ma': -2.47311027,
            'epoch': 2451545.0,
            'a': 2.00000261,
            'e': 0.02671123,
            'i': 0.00001531,
            'w_bar': 102.93768193,
            'w': 102.93768193,
            'L': 100.46457166,
            'om': 0,
            'P': 365.256
        }
        self.addPlayerObject("Probe", "Magellan", ephemeris, "test_user")

        self.colors = list()
        self.colors.append({'player': None, 'color': '0xff0000'})
        self.colors.append({'player': None, 'color': '0x00ff00'})
        self.colors.append({'player': None, 'color': '0x0000ff'})
        self.colors.append({'player': None, 'color': '0xffff00'})
        self.colors.append({'player': None, 'color': '0xff00ff'})
Exemple #4
0
 def __init__(self):
     self.OOIs = OOIs()
     self.players = list()
     self.eventList = getMockEventList()
     self._epoch = int(time()) # real-time game start