Poodletooth-iLand/toontown/coghq/FactoryManagerAI.py

28 lines
1 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from direct.directnotify import DirectNotifyGlobal
2015-03-04 04:42:16 -06:00
import DistributedMegaCorpAI
2015-03-03 16:10:12 -06:00
import DistributedFactoryAI
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
if entranceId == 2:
2015-03-04 04:42:16 -06:00
factory = DistributedMegaCorpAI.DistributedMegaCorpAI(self.air, factoryId, factoryZone, entranceId, players)
2015-07-05 18:59:25 -05:00
else:
2015-03-03 16:10:12 -06:00
factory = DistributedFactoryAI.DistributedFactoryAI(self.air, factoryId, factoryZone, entranceId, players)
factory.generateWithRequired(factoryZone)
return factoryZone