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


Python PartyUtils类代码示例

本文整理汇总了Python中PartyUtils的典型用法代码示例。如果您正苦于以下问题:Python PartyUtils类的具体用法?Python PartyUtils怎么用?Python PartyUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: generate

 def generate(self):
     DistributedObjectAI.generate(self)
     actId2Class = {
         ActivityIds.PartyJukebox: DistributedPartyJukeboxActivityAI,
         ActivityIds.PartyTrampoline: DistributedPartyTrampolineActivityAI,
         ActivityIds.PartyVictoryTrampoline: DistributedPartyVictoryTrampolineActivityAI,
         ActivityIds.PartyCatch: DistributedPartyCatchActivityAI,
         ActivityIds.PartyDance: DistributedPartyDanceActivityAI, 
         ActivityIds.PartyTugOfWar: DistributedPartyTugOfWarActivityAI,
         ActivityIds.PartyFireworks: DistributedPartyFireworksActivityAI,
         ActivityIds.PartyJukebox40: DistributedPartyJukebox40ActivityAI,
         ActivityIds.PartyDance20: DistributedPartyDance20ActivityAI,
         ActivityIds.PartyCog: DistributedPartyCogActivityAI,
     }
     for activity in self.info['activities']:
         actId = activity[0]
         if actId in actId2Class:
             act = actId2Class[actId](self.air, self.doId, activity)
             act.generateWithRequired(self.zoneId)
             self.activities.append(act)
         elif actId == ActivityIds.PartyCannon:
             if not self.cannonActivity:
                 self.cannonActivity = DistributedPartyCannonActivityAI(self.air, self.doId, activity)
                 self.cannonActivity.generateWithRequired(self.zoneId)
             act = DistributedPartyCannonAI(self.air)
             act.setActivityDoId(self.cannonActivity.doId)
             x, y, h = activity[1:]
             x = PartyUtils.convertDistanceFromPartyGrid(x, 0)
             y = PartyUtils.convertDistanceFromPartyGrid(y, 1)
             h *= PartyGridHeadingConverter
             act.setPosHpr(x,y,0,h,0,0)
             act.generateWithRequired(self.zoneId)
             self.activities.append(act)
开发者ID:ponyboy837,项目名称:SecretGitLolYoloSweg2015,代码行数:33,代码来源:DistributedPartyAI.py

示例2: announceGenerate

 def announceGenerate(self):
     # TODO - for some reason this is getting called hundreds of times when there are multiple districts
     DistributedObject.DistributedObject.announceGenerate(self)
     self.sendUpdate("enteredParty", [])
     globalClock.syncFrameTime()
     self.startPartyClock()
     base.localAvatar.chatMgr.chatInputSpeedChat.addInsidePartiesMenu()
     self.spawnTitleText()
     messenger.send(self.generatedEvent)
     if config.GetBool("show-debug-party-grid", 0):
         self.testGrid = NodePath("test_grid")
         self.testGrid.reparentTo(base.cr.playGame.hood.loader.geom)
         for i in xrange(len(self.grid)):
             for j in xrange(len(self.grid[i])):
                 cm = CardMaker("gridsquare")
                 np = NodePath(cm.generate())
                 np.setScale(12)
                 np.setP(-90.0)
                 np.setPos(
                     PartyUtils.convertDistanceFromPartyGrid(j, 0) - 6.0,
                     PartyUtils.convertDistanceFromPartyGrid(i, 1) - 6.0,
                     0.1,
                 )
                 np.reparentTo(self.testGrid)
                 if self.grid[i][j]:
                     np.setColorScale(0.0, 1.0, 0.0, 1.0)
                 else:
                     np.setColorScale(1.0, 0.0, 0.0, 1.0)
开发者ID:XamarinDeveloper,项目名称:src,代码行数:28,代码来源:DistributedParty.py

示例3: getClearSquarePositions

    def getClearSquarePositions(self):
        clearPositions = []
        for y in range(len(self.grid)):
            for x in range(len(self.grid[0])):
                if self.grid[y][x]:
                    pos = (PartyUtils.convertDistanceFromPartyGrid(x, 0), PartyUtils.convertDistanceFromPartyGrid(y, 1), 0.1)
                    clearPositions.append(pos)

        return clearPositions
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:9,代码来源:DistributedParty.py

示例4: loadDecorations

 def loadDecorations(self):
     self.decorationsList = []
     for decorBase in self.partyInfo.decors:
         self.decorationsList.append(
             Decoration(
                 PartyGlobals.DecorationIds.getString(decorBase.decorId),
                 PartyUtils.convertDistanceFromPartyGrid(decorBase.x, 0),
                 PartyUtils.convertDistanceFromPartyGrid(decorBase.y, 1),
                 PartyUtils.convertDegreesFromPartyGrid(decorBase.h),
             )
         )
开发者ID:XamarinDeveloper,项目名称:src,代码行数:11,代码来源:DistributedParty.py

示例5: handleToonExited

 def handleToonExited(self, toonId):
     DistributedPartyTeamActivity.handleToonExited(self, toonId)
     if toonId == base.localAvatar.doId:
         self.cameraMoveIval.pause()
         if toonId not in self.fallenToons:
             if toonId in self.toonIdsToAnimIntervals and self.toonIdsToAnimIntervals[toonId] is not None:
                 self.toonIdsToAnimIntervals[toonId].finish()
             toon = self.getAvatar(toonId)
             targetH = fitDestAngle2Src(toon.getH(self.root), 180.0)
             targetPos = self.hopOffPositions[self.getTeam(toonId)][self.getIndex(toonId, self.getTeam(toonId))]
             hopOffAnim = Sequence(
                 Func(toon.startPosHprBroadcast, 0.1),
                 toon.hprInterval(0.2, VBase3(targetH, 0.0, 0.0), other=self.root),
                 Func(toon.b_setAnimState, "jump", 1.0),
                 Wait(0.4),
                 PartyUtils.arcPosInterval(0.75, toon, targetPos, 5.0, self.root),
                 Func(toon.stopPosHprBroadcast),
                 Func(toon.sendCurrentPosition),
                 Func(self.hopOffFinished, toonId),
             )
             self.toonIdsToAnimIntervals[toonId] = hopOffAnim
             self._hopOffFinishedSV.set(False)
             self.toonIdsToAnimIntervals[toonId].start()
         else:
             self._hopOffFinishedSV.set(True)
             del self.toonIdsToAnimIntervals[toonId]
     return
开发者ID:XamarinDeveloper,项目名称:src,代码行数:27,代码来源:DistributedPartyTugOfWarActivity.py

示例6: announceGenerate

 def announceGenerate(self):
     DistributedObject.DistributedObject.announceGenerate(self)
     self.sendUpdate('enteredParty', [])
     globalClock.syncFrameTime()
     self.startPartyClock()
     base.localAvatar.chatMgr.chatInputSpeedChat.addInsidePartiesMenu()
     self.spawnTitleText()
     messenger.send(self.generatedEvent)
     if config.GetBool('show-debug-party-grid', 0):
         self.testGrid = NodePath('test_grid')
         self.testGrid.reparentTo(base.cr.playGame.hood.loader.geom)
         for i in range(len(self.grid)):
             for j in range(len(self.grid[i])):
                 cm = CardMaker('gridsquare')
                 np = NodePath(cm.generate())
                 np.setScale(12)
                 np.setP(-90.0)
                 np.setPos(PartyUtils.convertDistanceFromPartyGrid(j, 0) - 6.0, PartyUtils.convertDistanceFromPartyGrid(i, 1) - 6.0, 0.1)
                 np.reparentTo(self.testGrid)
                 if self.grid[i][j]:
                     np.setColorScale(0.0, 1.0, 0.0, 1.0)
                 else:
                     np.setColorScale(1.0, 0.0, 0.0, 1.0)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:23,代码来源:DistributedParty.py

示例7: setPartyClockInfo

 def setPartyClockInfo(self, x, y, h):
     x = PartyUtils.convertDistanceFromPartyGrid(x, 0)
     y = PartyUtils.convertDistanceFromPartyGrid(y, 1)
     h = PartyUtils.convertDegreesFromPartyGrid(h)
     self.partyClockInfo = (x, y, h)
     self.loadPartyCountdownTimer()
开发者ID:XamarinDeveloper,项目名称:src,代码行数:6,代码来源:DistributedParty.py


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