2019-11-02 17:27:54 -05:00
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import DistributedFactoryAI
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.toonbase import ToontownGlobals
|
|
|
|
from direct.showbase import DirectObject
|
|
|
|
|
|
|
|
class FactoryManagerAI(DirectObject.DirectObject):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory('FactoryManagerAI')
|
|
|
|
factoryId = None
|
|
|
|
|
|
|
|
def __init__(self, air):
|
|
|
|
DirectObject.DirectObject.__init__(self)
|
|
|
|
self.air = air
|
|
|
|
|
|
|
|
def getDoId(self):
|
|
|
|
return 0
|
|
|
|
|
|
|
|
def createFactory(self, factoryId, entranceId, players):
|
|
|
|
factoryZone = self.air.allocateZone()
|
|
|
|
if FactoryManagerAI.factoryId is not None:
|
|
|
|
factoryId = FactoryManagerAI.factoryId
|
|
|
|
factory = DistributedFactoryAI.DistributedFactoryAI(self.air, factoryId, factoryZone, entranceId, players)
|
|
|
|
factory.generateWithRequired(factoryZone)
|
|
|
|
return factoryZone
|