Esempio n. 1
0
        (x['end_date'], x['from_date'], int(x[SITUATION_DESIGN_KEY_NAME])),
        reverse=True)
    return result


# ---------- Initilization ----------

situations_designs_retriever: entity.EntityRetriever = entity.EntityRetriever(
    SITUATION_DESIGN_BASE_PATH, SITUATION_DESIGN_KEY_NAME,
    SITUATION_DESIGN_DESCRIPTION_PROPERTY_NAME, 'SituationDesigns')

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty(
            'Title',
            False,
            omit_if_none=False,
            entity_property_name=SITUATION_DESIGN_DESCRIPTION_PROPERTY_NAME)),
    'description':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty(
            'Description',
            False,
            omit_if_none=False,
            entity_property_name='SituationDescription')),
    'properties':
    entity.EntityDetailPropertyListCollection(
        [
            entity.EntityDetailProperty(
                'Event type',
                True,
Esempio n. 2
0
    CHARACTER_DESIGN_DESCRIPTION_PROPERTY_NAME,
    cache_name='CharacterDesigns'
)


collections_designs_retriever = entity.EntityRetriever(
    COLLECTION_DESIGN_BASE_PATH,
    COLLECTION_DESIGN_KEY_NAME,
    COLLECTION_DESIGN_DESCRIPTION_PROPERTY_NAME,
    cache_name='CollectionDesigns'
)


__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'character_title': entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Title', False, omit_if_none=False, transform_function=__get_name_with_level)
    ),
    'character_description': entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Description', False, omit_if_none=False, entity_property_name='CharacterDesignDescription'),
        property_short=entity.NO_PROPERTY
    ),
    'character_properties': entity.EntityDetailPropertyListCollection(
        [
            entity.EntityDetailProperty('Rarity', True, transform_function=__get_rarity),
            entity.EntityDetailProperty('Race', True, entity_property_name='RaceType'),
            entity.EntityDetailProperty('Collection', True, transform_function=__get_collection_name),
            entity.EntityDetailProperty('Gender', True, entity_property_name='GenderType'),
            entity.EntityDetailProperty('Ability', True, transform_function=__get_ability_stat),
            entity.EntityDetailProperty('HP', True, transform_function=__get_stat, stat_name='Hp'),
            entity.EntityDetailProperty('Attack', True, transform_function=__get_stat, stat_name='Attack'),
            entity.EntityDetailProperty('Repair', True, transform_function=__get_stat, stat_name='Repair'),
Esempio n. 3
0
# ---------- Initilization ----------

entities_designs_retriever = entity.EntityRetriever(
    ENTITY_DESIGN_BASE_PATH,
    ENTITY_DESIGN_KEY_NAME,
    ENTITY_DESIGN_DESCRIPTION_PROPERTY_NAME,
    cache_name='EntityDesigns')

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title':
    entity.EntityDetailPropertyCollection(entity.EntityDetailProperty(
        'Title',
        False,
        omit_if_none=False,
        entity_property_name='',
        transform_function=None),
                                          property_long=entity.NO_PROPERTY,
                                          property_short=entity.NO_PROPERTY,
                                          property_mini=entity.NO_PROPERTY),
    'description':
    entity.EntityDetailPropertyCollection(entity.EntityDetailProperty(
        'Description',
        False,
        omit_if_none=False,
        entity_property_name='',
        transform_function=None),
                                          property_long=entity.NO_PROPERTY,
                                          property_short=entity.NO_PROPERTY,
                                          property_mini=entity.NO_PROPERTY),
    'properties':
Esempio n. 4
0
        __properties['description'],
        __properties['properties'],
        __properties['embed_settings'],
        fleet_users_data,
        max_tourney_battle_attempts=max_tourney_battle_attempts,
        retrieved_at=retrieved_at,
        is_past_data=is_past_data)


# ---------- Initialization ----------

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Title',
                                    False,
                                    omit_if_none=False,
                                    transform_function=__get_name)),
    'description':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty(
            'Description',
            False,
            omit_if_none=True,
            transform_function=__get_description_as_text)),
    'properties':
    entity.EntityDetailPropertyListCollection([
        entity.EntityDetailProperty('Ranking',
                                    True,
                                    transform_function=__get_ranking),
        entity.EntityDetailProperty('Min trophies',
Esempio n. 5
0


# ---------- Initilization ----------

trainings_designs_retriever = entity.EntityRetriever(
    TRAINING_DESIGN_BASE_PATH,
    TRAINING_DESIGN_KEY_NAME,
    TRAINING_DESIGN_DESCRIPTION_PROPERTY_NAME,
    cache_name='TrainingDesigns',
    sorted_key_function=__get_key_for_training_sort
)

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title': entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Title', False, omit_if_none=False, entity_property_name=TRAINING_DESIGN_DESCRIPTION_PROPERTY_NAME),
        property_mini=entity.NO_PROPERTY
    ),
    'description': entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Description', False, omit_if_none=False, entity_property_name='TrainingDescription'),
        property_short=entity.NO_PROPERTY
    ),
    'properties': entity.EntityDetailPropertyListCollection([
            entity.EntityDetailProperty('Duration', True, transform_function=__get_duration),
            entity.EntityDetailProperty('Cost', True, transform_function=__get_costs),
            entity.EntityDetailProperty('Fatigue', True, transform_function=__get_fatigue),
            entity.EntityDetailProperty('Training room', True, transform_function=__get_training_room),
            entity.EntityDetailProperty('Research required', True, transform_function=__get_required_research),
            entity.EntityDetailProperty('Consumable', True, transform_function=__get_training_item_name),
            entity.EntityDetailProperty('Stat gain chances', False, transform_function=__get_stat_chances, text_only=True),
            entity.EntityDetailProperty('Stat gain chances', False, transform_function=__get_stat_chances, embed_only=True, add_line_breaks=True)
    ],
Esempio n. 6
0
        __properties['embed_settings'],
        fleet_info=fleet_info,
        ship_info=ship_info,
        max_tourney_battle_attempts=max_tourney_battle_attempts,
        retrieved_at=retrieved_at,
        is_past_data=is_past_data,
        is_in_tourney_fleet=is_in_tourney_fleet)


# ---------- Initialization ----------

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Title',
                                    False,
                                    omit_if_none=False,
                                    transform_function=__get_user_name)),
    'properties':
    entity.EntityDetailPropertyListCollection([
        entity.EntityDetailProperty('Account created',
                                    True,
                                    entity_property_name='CreationDate',
                                    transform_function=__get_timestamp),
        entity.EntityDetailProperty('Last Login',
                                    True,
                                    entity_property_name='LastLoginDate',
                                    transform_function=__get_timestamp),
        entity.EntityDetailProperty(
            'Fleet', True, transform_function=__get_fleet_name_and_rank),
        entity.EntityDetailProperty('Division',
Esempio n. 7
0
        return []


# ---------- Initilization ----------

researches_designs_retriever = entity.EntityRetriever(
    RESEARCH_DESIGN_BASE_PATH,
    RESEARCH_DESIGN_KEY_NAME,
    RESEARCH_DESIGN_DESCRIPTION_PROPERTY_NAME,
    cache_name='ResearchDesigns')

__properties = {
    'title':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty(
            'Title',
            False,
            omit_if_none=False,
            entity_property_name=RESEARCH_DESIGN_DESCRIPTION_PROPERTY_NAME)),
    'description':
    entity.EntityDetailPropertyCollection(entity.EntityDetailProperty(
        'Description',
        False,
        omit_if_none=False,
        entity_property_name='ResearchDescription'),
                                          property_short=entity.NO_PROPERTY),
    'properties':
    entity.EntityDetailPropertyListCollection(
        [
            entity.EntityDetailProperty(
                'Cost', True, transform_function=__get_costs),
            entity.EntityDetailProperty(
Esempio n. 8
0
def __create_news_details_from_info(
        news_info: EntityInfo) -> entity.EntityDetails:
    return entity.EntityDetails(news_info, __properties['title_news'],
                                __properties['description_news'],
                                __properties['properties_news'],
                                __properties['embed_settings'])


# ---------- Initilization ----------

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title_news':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Title',
                                    False,
                                    omit_if_none=False,
                                    entity_property_name='Title')),
    'description_news':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty('Description',
                                    False,
                                    entity_property_name='Description',
                                    transform_function=__sanitize_text)),
    'properties_news':
    entity.EntityDetailPropertyListCollection([
        entity.EntityDetailProperty('Link',
                                    True,
                                    entity_property_name='Link',
                                    transform_function=__get_value)
    ]),
Esempio n. 9
0

# ---------- Initilization ----------

items_designs_retriever: entity.EntityRetriever = entity.EntityRetriever(
    ITEM_DESIGN_BASE_PATH,
    ITEM_DESIGN_KEY_NAME,
    ITEM_DESIGN_DESCRIPTION_PROPERTY_NAME,
    'ItemsDesigns',
    fix_data_delegate=__fix_item_name)

__properties: entity.EntityDetailsCreationPropertiesCollection = {
    'title':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty(
            'Title',
            False,
            omit_if_none=False,
            entity_property_name=ITEM_DESIGN_DESCRIPTION_PROPERTY_NAME)),
    'title_ingredients':
    entity.EntityDetailPropertyCollection(
        entity.EntityDetailProperty(
            'Title',
            False,
            omit_if_none=False,
            entity_property_name=ITEM_DESIGN_DESCRIPTION_PROPERTY_NAME,
            transform_function=__get_title_ingredients), ),
    'description':
    entity.EntityDetailPropertyCollection(entity.EntityDetailProperty(
        'Description', False, entity_property_name='ItemDesignDescription'),
                                          property_short=entity.NO_PROPERTY),
    'base':