def populate( self, *args ): """ Populate a universe with a number of systems and planets. """ MinisecRuleset.populate( self, *args ) Object = self.model.use( 'Object' ) for planet in Object.ByType('Planet'): self.generator.addResourcesToPlanet( planet )
def addPlayer( self, username, password, email = 'Unknown', comment = 'A Minisec Player' ): """ Create a Solar System, Planet, and initial Fleet for the player, positioned randomly within the Universe. """ user, system, planet, fleet = MinisecRuleset.addPlayer( self, username, password, email, comment ) ResourceType = self.model.use( 'ResourceType' ) # Get the player's planet object and add the empire capital planet.resources = { ResourceType.ByName('House') : { 'accessible' : 1 }, ResourceType.ByName('Empire Capital') : { 'accessible' : 1 } } Model.update( planet )