Example #1
0
def __readBonus_nyToy(bonus, _name, section, eventType, year, checkLimit):
    if section.has_key('id'):
        tid = section['id'].asInt
        if year == YEARS_INFO.CURRENT_YEAR:
            cache = new_year.g_cache.toys
        else:
            cache = collectibles.g_cache[YEARS.getYearStrFromYearNum(year)].toys
        if tid not in cache:
            raise SoftException('Unknown NY{} toyID: {}'.format(year, tid))
        count = section['count'].asInt if section.has_key('count') else 0
        pureCount = section['pureCount'].asInt if section.has_key('pureCount') else count
        if pureCount > count:
            raise SoftException('Pure count should be less or equal than count', pureCount, count)
        toysCollectionKey = YEARS_INFO.getCollectionKeyForYear(year)
        nyToys = bonus.setdefault(toysCollectionKey, {})
        nyToys[tid] = {'count': count,
         'pureCount': pureCount}
Example #2
0
class Collections(CONST_CONTAINER):
    NewYear22 = YEARS.getYearStrFromYearNum(22)
    NewYear21 = YEARS.getYearStrFromYearNum(21)
    NewYear20 = YEARS.getYearStrFromYearNum(20)
    NewYear19 = YEARS.getYearStrFromYearNum(19)
    NewYear18 = YEARS.getYearStrFromYearNum(18)