コード例 #1
0
    def __init__(self,
                 air,
                 worldFile=None,
                 gameZone=WorldGlobals.ISLAND_GRID_STARTING_ZONE):
        WorldCreatorBase.__init__(self, air, worldFile)
        self.air = air

        self.world = None
        self.ocean = None
        self.gameZone = gameZone
コード例 #2
0
    def createObject(self,
                     object,
                     parent,
                     parentUid,
                     objKey,
                     dynamic,
                     parentIsObj=False,
                     fileName=None,
                     actualParentObj=None):
        objType = WorldCreatorBase.createObject(self, object, parent,
                                                parentUid, objKey, dynamic,
                                                parentIsObj, fileName,
                                                actualParentObj)

        if not objType:
            return (None, None)

        newObj = None
        objParent = None

        if objType == ObjectList.AREA_TYPE_WORLD_REGION:
            objParent = self.__createWorldInstance(object, parent, parentUid,
                                                   objKey, dynamic)
        else:
            newObj = self.world.builder.createObject(objType, object, parent,
                                                     parentUid, objKey,
                                                     dynamic, parentIsObj,
                                                     fileName, actualParentObj)

        return (newObj, objParent)
コード例 #3
0
    def loadObject(self,
                   object,
                   parent,
                   parentUid,
                   objKey,
                   dynamic,
                   parentIsObj=False,
                   fileName=None,
                   actualParentObj=None):
        objType = WorldCreatorBase.loadObject(self, object, parent, parentUid,
                                              objKey, dynamic, parentIsObj,
                                              fileName, actualParentObj)

        if objType == 'Island':
            self.world = DistributedInstanceWorldAI(self.air)
            self.world.generateWithRequired(zoneId=self.gameZone)
            self.world.generateIslands(object['Visual']['Model'],
                                       object['Name'], objKey,
                                       object['Undockable'], self.gameZone)

            self.ocean = DistributedOceanGridAI(self.air)
            self.ocean.generateWithRequired(zoneId=self.gameZone)
コード例 #4
0
 def loadObjectsFromFile(self, filename, parent=None, parentIsObj=False):
     return WorldCreatorBase.loadObjectsFromFile(self, filename, parent
                                                 or self.air, parentIsObj)
コード例 #5
0
    def __init__(self, air):
        self.air = air
        self.world = None

        WorldCreatorBase.__init__(self, air)