Exemple #1
0
class WorldManagerAI(WorldCreatorBase):
    notify = directNotify.newCategory('WorldManagerAI')

    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

    def isObjectInCurrentGamePhase(self, obj):
        if not obj:
            return False

        return True

    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)
Exemple #2
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)
    def __init__(self, air):
        DistributedInstanceWorldAI.__init__(self, air)

        self.type = PiratesGlobals.INSTANCE_MAIN
Exemple #4
0
    def delete(self):
        self.air.deallocateZone(self.zoneId)

        DistributedInstanceWorldAI.delete(self)