Добавление сущностей в FullEntity

This commit is contained in:
2025-10-06 17:12:22 +04:00
parent 1300f31234
commit 94c9ce1264
+40 -3
View File
@@ -4,6 +4,7 @@ using Pf2e.Database.Model;
using Pf2e.Database.Model.Base; using Pf2e.Database.Model.Base;
using Pf2e.Database.Model.Enum; using Pf2e.Database.Model.Enum;
using Pf2e.Database.Model.Structure; using Pf2e.Database.Model.Structure;
using Action = Pf2e.Database.Model.Structure.Action;
namespace Pf2e.Common; namespace Pf2e.Common;
@@ -89,6 +90,7 @@ public class FullEntity
/// </summary> /// </summary>
private readonly ICollection<Getter> _getters = private readonly ICollection<Getter> _getters =
[ [
new Getter<Action>(EntityType.Action, context => context.Actions),
new Getter<Ancestry>( new Getter<Ancestry>(
EntityType.Ancestry, EntityType.Ancestry,
context => context.Ancestries.Include(a => a.AncestryBoosts) context => context.Ancestries.Include(a => a.AncestryBoosts)
@@ -121,15 +123,41 @@ public class FullEntity
.Include(c => c.ClassProgressions) .Include(c => c.ClassProgressions)
.Include(c => c.SubclassGroups) .Include(c => c.SubclassGroups)
), ),
new Getter<Condition>(EntityType.Condition, context => context.Conditions),
new Getter<Deity>(
EntityType.Deity,
context =>
context
.Deities.Include(d => d.DeityAttributes)
.Include(d => d.DeityDomains)
.ThenInclude(dd => dd.Domain)
.Include(d => d.DeitySpells)
.ThenInclude(ds => ds.Spell)
.Include(d => d.DeityWeapons)
.ThenInclude(dw => dw.Weapon)
.Include(d => d.CategoryEntity)
.Include(d => d.Skills)
),
new Getter<DeityCategory>(EntityType.DeityCategory, context => context.DeityCategories),
new Getter<Domain>(
EntityType.Domain,
context =>
context
.Domains.Include(d => d.DomainSpell)
.Include(d => d.AdvancedDomainSpell)
.Include(d => d.ApocryphalSpell)
.Include(d => d.AdvancedApocryphalSpell)
),
new Getter<Feat>( new Getter<Feat>(
EntityType.Feat, EntityType.Feat,
context => context =>
context.Feats.Include(f => f.Archetypes).ThenInclude(a => a.Entity).AsQueryable() context.Feats.Include(f => f.Archetypes).ThenInclude(a => a.Entity).AsQueryable()
), ),
new Getter<Spell>( new Getter<Heritage>(
EntityType.Spell, EntityType.Heritage,
context => context.Spells.Include(s => s.SpellAreas).Include(s => s.SpellDefenses) context => context.Heritages.Include(h => h.Ancestry)
), ),
new Getter<Language>(EntityType.Language, context => context.Languages),
new Getter<Ritual>( new Getter<Ritual>(
EntityType.Ritual, EntityType.Ritual,
context => context =>
@@ -139,6 +167,14 @@ public class FullEntity
.ThenInclude(c => c.Training) .ThenInclude(c => c.Training)
.AsQueryable() .AsQueryable()
), ),
new Getter<Rule>(
EntityType.Rule,
context => context.Rules.Include(r => r.Parent).Include(r => r.Children)
),
new Getter<Spell>(
EntityType.Spell,
context => context.Spells.Include(s => s.SpellAreas).Include(s => s.SpellDefenses)
),
new Getter<Subclass>( new Getter<Subclass>(
EntityType.Subclass, EntityType.Subclass,
context => context =>
@@ -147,6 +183,7 @@ public class FullEntity
.ThenInclude(t => t.Training) .ThenInclude(t => t.Training)
.Include(s => s.Entities) .Include(s => s.Entities)
), ),
new Getter<Trait>(EntityType.Trait, context => context.Traits),
]; ];
/// <summary> /// <summary>