當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。