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


Python MovieCamera.chooseFireShot方法代码示例

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


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

示例1: doFires

# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseFireShot [as 别名]
def doFires(fires):
    if len(fires) == 0:
        return (None, None)
    
    suitFiresDict = { }
    for fire in fires:
        suitId = fire['target']['suit'].doId
        if suitFiresDict.has_key(suitId):
            suitFiresDict[suitId].append(fire)
            continue
        suitFiresDict[suitId] = [
            fire]
    
    suitFires = suitFiresDict.values()
    
    def compFunc(a, b):
        if len(a) > len(b):
            return 1
        elif len(a) < len(b):
            return -1
        
        return 0

    suitFires.sort(compFunc)
    totalHitDict = { }
    singleHitDict = { }
    groupHitDict = { }
    for fire in fires:
        suitId = fire['target']['suit'].doId
        if fire['target']['hp'] > 0:
            addHit(singleHitDict, suitId, 1)
            addHit(totalHitDict, suitId, 1)
        else:
            addHit(singleHitDict, suitId, 0)
            addHit(totalHitDict, suitId, 0)
        fire['target']['hp'] > 0
    
    notify.debug('singleHitDict = %s' % singleHitDict)
    notify.debug('groupHitDict = %s' % groupHitDict)
    notify.debug('totalHitDict = %s' % totalHitDict)
    delay = 0.0
    mtrack = Parallel()
    firedTargets = []
    for sf in suitFires:
        if len(sf) > 0:
            ival = __doSuitFires(sf)
            if ival:
                mtrack.append(Sequence(Wait(delay), ival))
            
            delay = delay + TOON_FIRE_SUIT_DELAY
            continue
    
    retTrack = Sequence()
    retTrack.append(mtrack)
    camDuration = retTrack.getDuration()
    camTrack = MovieCamera.chooseFireShot(fires, suitFiresDict, camDuration)
    return (retTrack, camTrack)
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:59,代码来源:MovieFire.py


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