当前位置: 首页>>代码示例>>Python>>正文


Python RaceGlobals.getNextRaceInfo方法代码示例

本文整理汇总了Python中toontown.racing.RaceGlobals.getNextRaceInfo方法的典型用法代码示例。如果您正苦于以下问题:Python RaceGlobals.getNextRaceInfo方法的具体用法?Python RaceGlobals.getNextRaceInfo怎么用?Python RaceGlobals.getNextRaceInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.racing.RaceGlobals的用法示例。


在下文中一共展示了RaceGlobals.getNextRaceInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: findRacingPads

# 需要导入模块: from toontown.racing import RaceGlobals [as 别名]
# 或者: from toontown.racing.RaceGlobals import getNextRaceInfo [as 别名]
    def findRacingPads(self, dnaGroup, zoneId, area, padType='racing_pad'):
        racingPads = []
        racingPadGroups = []
        if isinstance(dnaGroup, DNAGroup) and (padType in dnaGroup.getName()):
            racingPadGroups.append(dnaGroup)

            if padType == 'racing_pad':
                nameInfo = dnaGroup.getName().split('_')
                racingPad = DistributedRacePadAI(simbase.air)
                racingPad.setArea(zoneId)
                racingPad.nameType = nameInfo[3]
                racingPad.index = int(nameInfo[2])
                nextRaceInfo = RaceGlobals.getNextRaceInfo(-1, racingPad.nameType, racingPad.index)
                racingPad.setTrackInfo([nextRaceInfo[0], nextRaceInfo[1]])
                racingPad.generateWithRequired(zoneId)
            elif padType == 'viewing_pad':
                racingPad = DistributedViewPadAI(simbase.air)
                racingPad.setArea(zoneId)
                racingPad.generateWithRequired(zoneId)
            else:
                self.notify.error('Invalid racing pad type: ' + padType)

            racingPads.append(racingPad)
        elif isinstance(dnaGroup, DNAVisGroup):
            zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
        for i in xrange(dnaGroup.getNumChildren()):
            (foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaGroup.at(i), zoneId, area, padType=padType)
            racingPads.extend(foundRacingPads)
            racingPadGroups.extend(foundRacingPadGroups)
        return (racingPads, racingPadGroups)
开发者ID:nate97,项目名称:src,代码行数:32,代码来源:GSHoodAI.py

示例2: spawn

# 需要导入模块: from toontown.racing import RaceGlobals [as 别名]
# 或者: from toontown.racing.RaceGlobals import getNextRaceInfo [as 别名]
def spawn(air, zone, element, match):
    index = int(match.group(1))
    dest = match.group(2)
    pad = DistributedRacePadAI(air)
    pad.setArea(zone)
    pad.nameType = dest
    pad.index = index
    nri = RaceGlobals.getNextRaceInfo(-1, dest, index)
    pad.setTrackInfo(nri[:2])
    pad.generateWithRequired(zone)
    for child in element.children:
        if isinstance(child, DNAProp) and child.code == 'gs_parkingspot':
            index = int(child.name[15:])
            x, y, z = child.getPos()
            h, p, r = child.getHpr()
            startingBlock = DistributedStartingBlockAI(air)
            startingBlock.setPosHpr(x, y, z, h, p, r)
            startingBlock.setPadDoId(pad.getDoId())
            startingBlock.setPadLocationId(index)
            startingBlock.generateWithRequired(zone)
            pad.addStartingBlock(startingBlock)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:23,代码来源:DistributedRacePadAI.py

示例3: changeTrack

# 需要导入模块: from toontown.racing import RaceGlobals [as 别名]
# 或者: from toontown.racing.RaceGlobals import getNextRaceInfo [as 别名]
 def changeTrack(self):
     nri = RaceGlobals.getNextRaceInfo(self.trackId, self.nameType, self.index)
     self.b_setTrackInfo([nri[0], nri[1]])
     taskMgr.doMethodLater(30, DistributedRacePadAI.changeTrack, 'changeTrack%i' % self.doId, [self])
开发者ID:nate97,项目名称:src,代码行数:6,代码来源:DistributedRacePadAI.py

示例4: _createObjects

# 需要导入模块: from toontown.racing import RaceGlobals [as 别名]
# 或者: from toontown.racing.RaceGlobals import getNextRaceInfo [as 别名]
    def _createObjects(self, group, zone):
        if group.getName()[:13] == 'fishing_pond_':
            visGroup = group.getVisGroup()
            pondZone = 0
            if visGroup is None:
                pondZone = zone
            else:
                pondZone = int(visGroup.getName().split(':')[0])

            pondIndex = int(group.getName()[13:])
            pond = DistributedFishingPondAI(simbase.air)
            pond.setArea(zone)
            pond.generateWithRequired(pondZone)
            #self.ponds[pondIndex] = pond
            
            bingoManager = DistributedPondBingoManagerAI(simbase.air)
            bingoManager.setPondDoId(pond.getDoId())
            bingoManager.generateWithRequired(pondZone)
            #temporary, until we have scheduled stuff
            bingoManager.createGame()
            pond.bingoMgr = bingoManager
            simbase.air.fishManager.ponds[zone] = pond

            for i in range(FishingTargetGlobals.getNumTargets(zone)):
                target = DistributedFishingTargetAI(simbase.air)
                target.setPondDoId(pond.getDoId())
                target.generateWithRequired(pondZone)

            for i in range(group.getNumChildren()):
                posSpot = group.at(i)
                if posSpot.getName()[:13] == 'fishing_spot_':
                    spot = DistributedFishingSpotAI(simbase.air)
                    spot.setPondDoId(pond.getDoId())
                    x, y, z = posSpot.getPos()
                    h, p, r = posSpot.getHpr()
                    spot.setPosHpr(x, y, z, h, p, r)
                    spot.generateWithRequired(pondZone)
                    
            NPCToons.createNpcsInZone(simbase.air, pondZone)
      
        elif group.getName()[:10] == 'racing_pad':
            index, dest = group.getName()[11:].split('_', 2)
            index = int(index)
            
            pad = DistributedRacePadAI(simbase.air)
            pad.setArea(zone)
            pad.nameType = dest
            pad.index = index
            nri = RaceGlobals.getNextRaceInfo(-1, dest, index)
            pad.setTrackInfo([nri[0], nri[1]])
            pad.generateWithRequired(zone)
            for i in range(group.getNumChildren()):
                posSpot = group.at(i)
                if posSpot.getName()[:14] == 'starting_block':
                    spotIndex = int(posSpot.getName()[15:])
                    x, y, z = posSpot.getPos()
                    h, p, r = posSpot.getHpr()
                    startingBlock = DistributedStartingBlockAI(simbase.air)
                    startingBlock.setPosHpr(x, y, z, h, p, r)
                    startingBlock.setPadDoId(pad.getDoId())
                    startingBlock.setPadLocationId(index)
                    startingBlock.generateWithRequired(zone)
                    pad.addStartingBlock(startingBlock)
        elif group.getName()[:11] == 'viewing_pad':
            pad = DistributedViewPadAI(simbase.air)
            pad.setArea(zone)
            pad.generateWithRequired(zone)
            for i in range(group.getNumChildren()):
                posSpot = group.at(i)
                if posSpot.getName()[:14] == 'starting_block':
                    spotIndex = int(posSpot.getName()[15:])
                    x, y, z = posSpot.getPos()
                    h, p, r = posSpot.getHpr()
                    startingBlock = DistributedViewingBlockAI(simbase.air)
                    startingBlock.setPosHpr(x, y, z, h, p, r)
                    startingBlock.setPadDoId(pad.getDoId())
                    startingBlock.setPadLocationId(0)
                    startingBlock.generateWithRequired(zone)
                    pad.addStartingBlock(startingBlock)
        if group.getName()[:15] == 'prop_party_gate':
            gate = DistributedPartyGateAI(simbase.air)
            gate.setArea(zone)
            gate.generateWithRequired(zone)
        for i in range(group.getNumChildren()):
            self._createObjects(group.at(i), zone)
开发者ID:OldToontown,项目名称:OldToontown,代码行数:87,代码来源:DNASpawnerAI.py

示例5: _createObjects

# 需要导入模块: from toontown.racing import RaceGlobals [as 别名]
# 或者: from toontown.racing.RaceGlobals import getNextRaceInfo [as 别名]
    def _createObjects(self, group, zone):
        if group.getName()[:13] == "fishing_pond_":
            visGroup = group.getVisGroup()
            pondZone = 0
            if visGroup is None:
                pondZone = zone
            else:
                pondZone = int(visGroup.getName().split(":")[0])

            pondIndex = int(group.getName()[13:])
            pond = DistributedFishingPondAI(simbase.air)
            pond.setArea(zone)
            pond.generateWithRequired(pondZone)

            bingoManager = DistributedPondBingoManagerAI(simbase.air)
            bingoManager.setPondDoId(pond.getDoId())
            bingoManager.generateWithRequired(pondZone)
            # temporary, until we have scheduled stuff
            bingoManager.createGame()
            pond.bingoMgr = bingoManager
            simbase.air.fishManager.ponds[zone] = pond

            for i in range(FishingTargetGlobals.getNumTargets(zone)):
                target = DistributedFishingTargetAI(simbase.air)
                target.setPondDoId(pond.getDoId())
                target.generateWithRequired(pondZone)

            for i in range(group.getNumChildren()):
                posSpot = group.at(i)
                if posSpot.getName()[:13] == "fishing_spot_":
                    posSpot = group.atAsNode(i)
                    spot = DistributedFishingSpotAI(simbase.air)
                    spot.setPondDoId(pond.getDoId())
                    x, y, z = posSpot.getPos()
                    h, p, r = posSpot.getHpr()
                    spot.setPosHpr(x, y, z, h, p, r)
                    spot.generateWithRequired(pondZone)

            NPCToons.createNpcsInZone(simbase.air, pondZone)

        elif group.getName()[:10] == "racing_pad":
            index, dest = group.getName()[11:].split("_", 2)
            index = int(index)

            pad = DistributedRacePadAI(simbase.air)
            pad.setArea(zone)
            pad.nameType = dest
            pad.index = index
            nri = RaceGlobals.getNextRaceInfo(-1, dest, index)
            pad.setTrackInfo([nri[0], nri[1]])
            pad.generateWithRequired(zone)
            for i in range(group.getNumChildren()):
                posSpot = group.at(i)
                if posSpot.getName()[:14] == "starting_block":
                    spotIndex = int(posSpot.getName()[15:])
                    posSpot = group.atAsNode(i)
                    x, y, z = posSpot.getPos()
                    h, p, r = posSpot.getHpr()
                    startingBlock = DistributedStartingBlockAI(simbase.air)
                    startingBlock.setPosHpr(x, y, z, h, p, r)
                    startingBlock.setPadDoId(pad.getDoId())
                    startingBlock.setPadLocationId(index)
                    startingBlock.generateWithRequired(zone)
                    pad.addStartingBlock(startingBlock)

        elif group.getName()[:11] == "viewing_pad":
            pad = DistributedViewPadAI(simbase.air)
            pad.setArea(zone)
            pad.generateWithRequired(zone)
            for i in range(group.getNumChildren()):
                posSpot = group.at(i)
                if posSpot.getName()[:14] == "starting_block":
                    spotIndex = int(posSpot.getName()[15:])
                    posSpot = group.atAsNode(i)
                    x, y, z = posSpot.getPos()
                    h, p, r = posSpot.getHpr()
                    startingBlock = DistributedViewingBlockAI(simbase.air)
                    startingBlock.setPosHpr(x, y, z, h, p, r)
                    startingBlock.setPadDoId(pad.getDoId())
                    startingBlock.setPadLocationId(0)
                    startingBlock.generateWithRequired(zone)
                    pad.addStartingBlock(startingBlock)

        elif group.getName()[:13] == "picnic_table_" and zone != 7000:
            pos = group.getPos()
            hpr = group.getHpr()
            nameInfo = group.getName().split("_")
            picnicTable = DistributedPicnicBasketAI.DistributedPicnicBasketAI(
                simbase.air, nameInfo[2], pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2]
            )
            picnicTable.generateWithRequired(zone)
            picnicTable.start()

        elif group.getName() == "prop_game_table_DNARoot" and config.GetBool("want-oz-game-tables", True):
            pos = group.getPos()
            hpr = group.getHpr()
            nameInfo = group.getName().split("_")
            tableIndex = int(group.parent.getName().split("_")[-1])
            picnicTable = DistributedPicnicTableAI.DistributedPicnicTableAI(
                simbase.air, zone, nameInfo[2], pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2]
#.........这里部分代码省略.........
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:103,代码来源:DNASpawnerAI.py


注:本文中的toontown.racing.RaceGlobals.getNextRaceInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。