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


Python MovieCamera.chooseDropShot方法代码示例

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


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

示例1: doDrops

# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseDropShot [as 别名]
def doDrops(drops):
    if len(drops) == 0:
        return (None, None)
    
    suitDropsDict = { }
    for drop in drops:
        suitId = drop['target']['suit'].doId
        if suitDropsDict.has_key(suitId):
            suitDropsDict[suitId].append(drop)
        else:
            suitDropsDict[suitId] = [
                drop]
    
    suitDrops = suitDropsDict.values()
    
    def compFunc(a, b):
        if len(a) > len(b):
            return 1
        elif len(a) < len(b):
            return -1
        
        return 0

    suitDrops.sort(compFunc)
    delay = 0.0
    tracks = []
    for st in suitDrops:
        if len(st) > 0:
            ival = __doSuitDrops(st)
            if ival:
                tracks.append(Track([
                    (delay, ival)]))
            
            delay = delay + TOON_DROP_SUIT_DELAY
        
    
    mtrack = MultiTrack(tracks, name = 'toplevel-drop')
    camDuration = mtrack.getDuration()
    camTrack = MovieCamera.chooseDropShot(drops, suitDropsDict, camDuration)
    return (mtrack, camTrack)
开发者ID:Toonerz,项目名称:Toontown-2003,代码行数:42,代码来源:MovieDrop.py

示例2: doDrops

# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseDropShot [as 别名]
def doDrops(drops):
    if len(drops) == 0:
        return (None, None)
    npcArrivals, npcDepartures, npcs = MovieNPCSOS.doNPCTeleports(drops)
    suitDropsDict = {}
    groupDrops = []
    for drop in drops:
        track = drop['track']
        level = drop['level']
        targets = drop['target']
        if len(targets) == 1:
            suitId = targets[0]['suit'].doId
            if suitId in suitDropsDict:
                suitDropsDict[suitId].append((drop, targets[0]))
            else:
                suitDropsDict[suitId] = [(drop, targets[0])]
        elif level <= MAX_LEVEL_INDEX and attackAffectsGroup(track, level):
            groupDrops.append(drop)
        else:
            for target in targets:
                suitId = target['suit'].doId
                if suitId in suitDropsDict:
                    otherDrops = suitDropsDict[suitId]
                    alreadyInList = 0
                    for oDrop in otherDrops:
                        if oDrop[0]['toon'] == drop['toon']:
                            alreadyInList = 1

                    if alreadyInList == 0:
                        suitDropsDict[suitId].append((drop, target))
                else:
                    suitDropsDict[suitId] = [(drop, target)]

    suitDrops = suitDropsDict.values()

    def compFunc(a, b):
        if len(a) > len(b):
            return 1
        elif len(a) < len(b):
            return -1
        return 0

    suitDrops.sort(compFunc)
    delay = 0.0
    mtrack = Parallel(name='toplevel-drop')
    npcDrops = {}
    for st in suitDrops:
        if len(st) > 0:
            ival = __doSuitDrops(st, npcs, npcDrops)
            if ival:
                mtrack.append(Sequence(Wait(delay), ival))
            delay = delay + TOON_DROP_SUIT_DELAY

    dropTrack = Sequence(npcArrivals, mtrack, npcDepartures)
    camDuration = mtrack.getDuration()
    if groupDrops:
        ival = __doGroupDrops(groupDrops)
        dropTrack.append(ival)
        camDuration += ival.getDuration()
    enterDuration = npcArrivals.getDuration()
    exitDuration = npcDepartures.getDuration()
    camTrack = MovieCamera.chooseDropShot(drops, suitDropsDict, camDuration, enterDuration, exitDuration)
    return (dropTrack, camTrack)
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:65,代码来源:MovieDrop.py


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