Ejemplo n.º 1
0
 def get_details(self, content_api: Content):
     if self.index:
         return Equipment.parse_detail(content_api.get_detail(self.url))
Ejemplo n.º 2
0
 def get_details(self, content_api: Content):
     if self.index:
         return Language.parse_detail(content_api.get_detail(self.url))
Ejemplo n.º 3
0
    return ability_scores

def get_languages(content_api):
    languages = [Language.parse_summary(e).get_details(content_api) for e in content_api.get_summary("languages")]
    return languages

def get_alignments(content_api):
    alignments = [Alignment.parse_summary(e).get_details(content_api) for e in content_api.get_summary("alignments")]
    return alignments

def get_equipment_categories(content_api):
    equipment_categories = [EquipmentCategory.parse_summary(e).get_details(content_api) for e in content_api.get_summary("equipment-categories")]
    for equipment_category in equipment_categories:
        equipment_category.get_equipment(content_api)
    return equipment_categories

def get_monsters(content_api):
    monsters = [Monster.parse_summary(e).get_details(content_api) for e in content_api.get_summary("monsters")]
    # for monster in monsters:
    #     monster.get_equipment(content_api)
    return monsters


if __name__ == '__main__':
    content_api = Content(load_caches=True)
    print(f"Spells: {get_spells(content_api)}")
    print(f"Skills: {get_skills(content_api)}")
    print(f"Ability Scores: {get_ability_scores(content_api)}")
    print(f"Languages: {get_languages(content_api)}")
    print(f"Monsters: {get_monsters(content_api)}")
    content_api.dump_caches()
Ejemplo n.º 4
0
 def get_details(self, content_api: Content):
     if self.index:
         return AbilityScore.parse_detail(content_api.get_detail(self.url))
Ejemplo n.º 5
0
 def get_details(self, content_api: Content):
     if self.index:
         return Monster.parse_detail(content_api.get_detail(self.url))