• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python sub_parsers._parseID函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _readProgressSection

def _readProgressSection(xmlCtx, section, _):
    progressID = sub_parsers._parseID(xmlCtx, section, 'Specify a progress ID')
    conditions = []
    for _, subSec in _xml.getChildren(xmlCtx, section, 'steps'):
        condID = sub_parsers._parseID(xmlCtx, subSec, 'Specify a condition ID')
        conditions.append(chapter.HasIDConditions(sub_parsers._parseID(xmlCtx, subSec, 'Specify a condition ID'), sub_parsers._readConditions(xmlCtx, subSec, [])))

    return chapter.ChapterProgress(progressID, conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:8,代码来源:battle.py


示例2: _readSetFilterSection

def _readSetFilterSection(xmlCtx, section, _, conditions):
    filterID = sub_parsers._parseID(xmlCtx, section, 'Specify a filter ID')
    value = []
    for name, subSec in _xml.getChildren(xmlCtx, section, 'value'):
        value.append(sub_parsers._readVarValue(name, subSec))

    return chapter.SetFilter(filterID, tuple(value), conditions=conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:7,代码来源:lobby.py


示例3: __readGuiItemsSection

 def __readGuiItemsSection(self, xmlCtx, section):
     self.__guiItems.clear()
     for _, subSection in _xml.getChildren(xmlCtx, section, 'gui-items'):
         itemID = sub_parsers._parseID(xmlCtx, subSection, 'Specify a GUI item ID')
         path = _xml.readString(xmlCtx, subSection, 'path')
         self.__guiItems[itemID] = {'path': path,
          'locked': True}
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:7,代码来源:tutorialconfig.py


示例4: _readChapterTaskSection

def _readChapterTaskSection(xmlCtx, section, _):
    taskID = sub_parsers._parseID(xmlCtx, section, 'Specify a task ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    flagID = None
    if 'flag' in section.keys():
        flagID = _xml.readString(xmlCtx, section, 'flag')
    return chapter.ChapterTask(taskID, text, flagID=flagID)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:7,代码来源:battle.py


示例5: parse

    def parse(self, chapter, afterBattle = False, initial = False):
        filePath = chapter.getFilePath(afterBattle=afterBattle)
        section = ResMgr.openSection(filePath)
        if section is None:
            _xml.raiseWrongXml(None, filePath, 'can not open or read')
        xmlCtx = (None, filePath)
        chapter.clear()
        flags = []
        itemFlags = []
        if 'initial-scene' in section.keys():
            chapter.setInitialSceneID(_xml.readString(xmlCtx, section, 'initial-scene'))
        if 'default-scene' in section.keys():
            chapter.setDefaultSceneID(_xml.readString(xmlCtx, section, 'default-scene'))
        for name, subSec in _xml.getChildren(xmlCtx, section, 'has-id'):
            entity = sub_parsers._parseEntity(xmlCtx, name, subSec, flags)
            if entity is not None:
                chapter.addHasIDEntity(entity)

        for _, subSec in _xml.getChildren(xmlCtx, section, 'triggers'):
            trigger = sub_parsers._parseTrigger(xmlCtx, subSec, flags, chapter)
            if trigger is not None:
                chapter.addTrigger(trigger)

        gVarIDs = []
        for name, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
            if name == 'var-set':
                chapter.addVarSet(sub_parsers._parseVarSet(xmlCtx, subSec, flags))
            elif name == 'var-set-ref':
                gVarIDs.append(sub_parsers._parseID(xmlCtx, subSec, 'Specify a var ID'))
            else:
                _xml.raiseWrongXml(xmlCtx, name, 'Unknown tag')

        if len(gVarIDs):
            GlobalRefParser().parse(chapter, varIDs=gVarIDs, flags=flags)
        for _, sceneSec in _xml.getChildren(xmlCtx, section, 'scenes'):
            sceneID = sub_parsers._parseID(xmlCtx, sceneSec, 'Specify a unique name for the scene')
            scene = Scene(entityID=sceneID)
            self.__parseScene(xmlCtx, sceneSec, scene, flags, itemFlags, afterBattle=afterBattle)
            chapter.addScene(scene)

        if initial:
            scene = chapter.getInitialScene()
            self.__parseSharedScene(chapter, scene, flags, itemFlags)
        flags = filter(lambda flag: flag not in itemFlags, flags)
        chapter.setFlags(flags)
        chapter.setValid(True)
        return chapter
开发者ID:wotmods,项目名称:WOTDecompiled,代码行数:47,代码来源:parsers.py


示例6: _readGreetingSection

def _readGreetingSection(xmlCtx, section, _):
    greetingID = sub_parsers._parseID(xmlCtx, section, 'Specify a greeting ID')
    title = translation(_xml.readString(xmlCtx, section, 'title'))
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    speakID = None
    if 'speak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'speak')
    return chapter.Greeting(greetingID, title, text, speakID=speakID)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:8,代码来源:battle.py


示例7: _readMarkerSection

def _readMarkerSection(xmlCtx, section, _):
    markerID = sub_parsers._parseID(xmlCtx, section, 'Specify a marker ID')
    type = _xml.readString(xmlCtx, section, 'type')
    marker = None
    if type in _MARKER_TYPES:
        parser = _MARKER_TYPES[type]
        marker = parser(xmlCtx, section, markerID, _xml.readString(xmlCtx, section, 'var-ref'))
    else:
        LOG_ERROR('Marker is not supported:', type)
    return marker
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:10,代码来源:battle.py


示例8: _readHintSection

def _readHintSection(xmlCtx, section, _):
    hintID = sub_parsers._parseID(xmlCtx, section, 'Specify a hint ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    image = None
    if 'image' in section.keys():
        image = _xml.readString(xmlCtx, section, 'image')
    speakID = None
    if 'speak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'speak')
    return chapter.SimpleHint(hintID, text, image=image, speakID=speakID)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:10,代码来源:battle.py


示例9: _readImageSection

def _readImageSection(xmlCtx, section, _):
    imageID = sub_parsers._parseID(xmlCtx, section, 'Specify a image ID')
    imageType = _xml.readString(xmlCtx, section, 'type')
    image = None
    if imageType in _IMAGE_TYPES:
        parser = _IMAGE_TYPES[imageType]
        image = parser(xmlCtx, section, imageID)
    else:
        LOG_ERROR('Image is not supported:', imageType)
    return image
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:10,代码来源:battle.py


示例10: __readCommandsSection

    def __readCommandsSection(self, xmlCtx, section):
        self.__commands.clear()
        for _, subSection in _xml.getChildren(xmlCtx, section, 'gui-commands'):
            commandID = sub_parsers._parseID(xmlCtx, subSection, 'Specify a command ID')
            cmdType = _xml.readString(xmlCtx, subSection, 'type')
            command = _xml.readString(xmlCtx, subSection, 'name')
            argsSec = _xml.getChildren(xmlCtx, subSection, 'args')
            args = []
            for name, argSec in argsSec:
                args.append(sub_parsers._readVarValue(name, argSec))

            self.__commands[commandID] = CommandData(cmdType, command, args)
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:12,代码来源:tutorialconfig.py


示例11: _parseHint

def _parseHint(xmlCtx, section, _):
    hintID = sub_parsers._parseID(xmlCtx, section, 'Specify a hint ID')
    targetID = _xml.readString(xmlCtx, section, 'gui-item-ref')
    containerID = section.readString('container-ref')
    if not len(containerID):
        containerID = None
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    inPin = _xml.readString(xmlCtx, section, 'inPin')
    outPin = _xml.readString(xmlCtx, section, 'outPin')
    line = _xml.readString(xmlCtx, section, 'line')
    position = section.readVector2('position')
    topmostLevel = section.readBool('topmost-level', True)
    return chapter.ItemHint(hintID, targetID, containerID, position, text, inPin, outPin, line, topmostLevel)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:13,代码来源:lobby.py


示例12: _readExitQueueEffectSection

def _readExitQueueEffectSection(xmlCtx, section, flags, conditions):
    flagID = sub_parsers._parseID(xmlCtx, section, 'Specify a flag ID')
    if flagID not in flags:
        flags.append(flagID)
    return chapter.HasTargetEffect(flagID, chapter.Effect.EXIT_QUEUE, conditions=conditions)
开发者ID:wotmods,项目名称:WOTDecompiled,代码行数:5,代码来源:offbattle.py


示例13: _readShowMarkerSection

def _readShowMarkerSection(xmlCtx, section, _, conditions):
    markerID = sub_parsers._parseID(xmlCtx, section, 'Specify a marker ID')
    return chapter.HasTargetEffect(markerID, chapter.Effect.SHOW_MARKER, conditions=conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:battle.py


示例14: _readDispatcherTriggerSection

def _readDispatcherTriggerSection(xmlCtx, section, _, triggerID):
    triggerIDs = set()
    for _, subSec in _xml.getChildren(xmlCtx, section, 'includes'):
        triggerIDs.add(sub_parsers._parseID(xmlCtx, subSec, 'Specify a trigger ID'))

    return triggers.TriggersDispatcher(triggerID, triggerIDs)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:6,代码来源:battle.py


示例15: _readShowGreetingSection

def _readShowGreetingSection(xmlCtx, section, _, conditions):
    greetingID = sub_parsers._parseID(xmlCtx, section, 'Specify a greeting ID')
    return chapter.HasTargetEffect(greetingID, chapter.Effect.SHOW_GREETING, conditions=conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:battle.py


示例16: _readTeleportSection

def _readTeleportSection(xmlCtx, section, _, conditions):
    pointID = sub_parsers._parseID(xmlCtx, section, 'Specify a point ID')
    return chapter.HasTargetEffect(pointID, chapter.Effect.TELEPORT, conditions=conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:battle.py


示例17: _readExitSection

def _readExitSection(xmlCtx, section, _):
    exitID = sub_parsers._parseID(xmlCtx, section, 'Specify a exit ID')
    return chapter.Exit(exitID, nextChapter=_xml.readString(xmlCtx, section, 'chapter-id'), nextDelay=_xml.readFloat(xmlCtx, section, 'next-delay'), finishDelay=section.readFloat('finish-delay'), isSpeakOver=section.readBool('is-speak-over'))
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:battle.py


示例18: _parseChapterInfoCondition

def _parseChapterInfoCondition(xmlCtx, section, _):
    conditionID = sub_parsers._parseID(xmlCtx, section, 'Specify a charter info ID')
    return chapter.HasIDConditions(sub_parsers._parseID(xmlCtx, section, 'Specify a charter info condition ID'), sub_parsers._readConditions(xmlCtx, section, []))
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:lobby.py


示例19: _readCloseHintSection

def _readCloseHintSection(xmlCtx, section, _, conditions):
    hintID = sub_parsers._parseID(xmlCtx, section, 'Specify a hint ID')
    return chapter.HasTargetEffect(hintID, chapter.Effect.CLOSE_HINT, conditions=conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:lobby.py


示例20: _readNextTaskSection

def _readNextTaskSection(xmlCtx, section, _, conditions):
    taskID = sub_parsers._parseID(xmlCtx, section, 'Specify a next task ID')
    return chapter.HasTargetEffect(taskID, chapter.Effect.NEXT_TASK, conditions=conditions)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:battle.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sub_parsers.parseID函数代码示例发布时间:2022-05-27
下一篇:
Python context.GlobalStorage类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap