示例#1
0
def readSoundSiegeModeStateChange(xmlCtx, section):
    """Reads soundStateChange section for siege mode.
    :param xmlCtx: tuple(root ctx or None, path to section).
    :param section: instance of DataSection.
    :return: instance of LeveredSuspensionConfig for levered suspension or None.
    """
    return sound_components.SoundSiegeModeStateChange(
        on=_xml.readStringOrNone(xmlCtx, section, 'soundStateChange/on'),
        off=_xml.readStringOrNone(xmlCtx, section, 'soundStateChange/off'))
def readSoundSiegeModeStateChange(xmlCtx, section):
    pcOn = _xml.readStringOrEmpty(xmlCtx, section, 'soundStateChange/on')
    pcOff = _xml.readStringOrEmpty(xmlCtx, section, 'soundStateChange/off')
    npcOn = _xml.readStringOrEmpty(xmlCtx, section, 'soundStateChange/npcOn')
    npcOff = _xml.readStringOrEmpty(xmlCtx, section, 'soundStateChange/npcOff')
    return sound_components.SoundSiegeModeStateChange(
        on=pcOn,
        off=pcOff,
        npcOn=npcOn,
        npcOff=npcOff,
        isEngine=_xml.readBool(xmlCtx, section, 'soundStateChange/isEngine',
                               False))
def readSoundSiegeModeStateChange(xmlCtx, section):
    return sound_components.SoundSiegeModeStateChange(
        on=_xml.readStringOrNone(xmlCtx, section, 'soundStateChange/on'),
        off=_xml.readStringOrNone(xmlCtx, section, 'soundStateChange/off'))