Ejemplo n.º 1
0
def getDivisionsOrderData():
    ORDER = SORTIE_DIVISION._ORDER
    result = [''] * len(ORDER)
    for level, name in SORTIE_DIVISION_NAMES.iteritems():
        if level in ORDER:
            result[ORDER.index(level)] = (name, level, SORTIE_DIVISION_NAME_TO_FLAGS[name])

    return result
Ejemplo n.º 2
0
def getDivisionsOrderData():
    ORDER = SORTIE_DIVISION._ORDER
    result = [''] * len(ORDER)
    for level, name in SORTIE_DIVISION_NAMES.iteritems():
        if level in ORDER:
            result[ORDER.index(level)] = (name, level, SORTIE_DIVISION_NAME_TO_FLAGS[name])

    return result
Ejemplo n.º 3
0
# 2015.11.10 21:26:00 Støední Evropa (bìžný èas)
# Embedded file name: scripts/client/gui/prb_control/items/sortie_items.py
from UnitBase import SORTIE_DIVISION_NAMES, SORTIE_DIVISION, SORTIE_DIVISION_NAME_TO_FLAGS
from debug_utils import LOG_ERROR
_SORTIE_DIVISION_LEVEL_TO_NAME = dict([ (v, k) for k, v in SORTIE_DIVISION_NAMES.iteritems() ])

def getDivisionsOrderData():
    ORDER = SORTIE_DIVISION._ORDER
    result = [''] * len(ORDER)
    for level, name in SORTIE_DIVISION_NAMES.iteritems():
        if level in ORDER:
            result[ORDER.index(level)] = (name, level, SORTIE_DIVISION_NAME_TO_FLAGS[name])

    return result


def getDivisionLevel(name):
    level = 0
    if name in _SORTIE_DIVISION_LEVEL_TO_NAME:
        level = _SORTIE_DIVISION_LEVEL_TO_NAME[name]
    else:
        LOG_ERROR('Name of division is not valid', level)
    return level


def getDivisionLevelByUnit(unit):
    divisionName = getDivisionNameByType(unit.getRosterTypeID())
    if divisionName:
        return getattr(SORTIE_DIVISION, getDivisionNameByType(unit.getRosterTypeID()))

Ejemplo n.º 4
0
# Embedded file name: scripts/client/gui/prb_control/items/sortie_items.py
from UnitBase import SORTIE_DIVISION_NAMES, SORTIE_DIVISION, SORTIE_DIVISION_NAME_TO_FLAGS
from debug_utils import LOG_ERROR
_SORTIE_DIVISION_LEVEL_TO_NAME = dict([ (v, k) for k, v in SORTIE_DIVISION_NAMES.iteritems() ])

def getDivisionsOrderData():
    ORDER = SORTIE_DIVISION._ORDER
    result = [''] * len(ORDER)
    for level, name in SORTIE_DIVISION_NAMES.iteritems():
        if level in ORDER:
            result[ORDER.index(level)] = (name, level, SORTIE_DIVISION_NAME_TO_FLAGS[name])

    return result


def getDivisionLevel(name):
    level = 0
    if name in _SORTIE_DIVISION_LEVEL_TO_NAME:
        level = _SORTIE_DIVISION_LEVEL_TO_NAME[name]
    else:
        LOG_ERROR('Name of division is not valid', level)
    return level


def getDivisionLevelByUnit(unit):
    divisionName = getDivisionNameByType(unit.getRosterTypeID())
    if divisionName:
        return getattr(SORTIE_DIVISION, getDivisionNameByType(unit.getRosterTypeID()))


def getDivisionNameByType(rosterTypeID):
Ejemplo n.º 5
0
# 2016.08.04 19:49:25 Støední Evropa (letní èas)
# Embedded file name: scripts/client/gui/prb_control/items/sortie_items.py
from UnitBase import SORTIE_DIVISION_NAMES, SORTIE_DIVISION, SORTIE_DIVISION_NAME_TO_FLAGS
from debug_utils import LOG_ERROR

_SORTIE_DIVISION_LEVEL_TO_NAME = dict([
    (v, k) for k, v in SORTIE_DIVISION_NAMES.iteritems()
])


def getDivisionsOrderData():
    ORDER = SORTIE_DIVISION._ORDER
    result = [''] * len(ORDER)
    for level, name in SORTIE_DIVISION_NAMES.iteritems():
        if level in ORDER:
            result[ORDER.index(level)] = (name, level,
                                          SORTIE_DIVISION_NAME_TO_FLAGS[name])

    return result


def getDivisionLevel(name):
    level = 0
    if name in _SORTIE_DIVISION_LEVEL_TO_NAME:
        level = _SORTIE_DIVISION_LEVEL_TO_NAME[name]
    else:
        LOG_ERROR('Name of division is not valid', level)
    return level


def getDivisionLevelByUnit(unit):