Добавление сущностей в FullEntity
This commit is contained in:
@@ -4,6 +4,7 @@ using Pf2e.Database.Model;
|
||||
using Pf2e.Database.Model.Base;
|
||||
using Pf2e.Database.Model.Enum;
|
||||
using Pf2e.Database.Model.Structure;
|
||||
using Action = Pf2e.Database.Model.Structure.Action;
|
||||
|
||||
namespace Pf2e.Common;
|
||||
|
||||
@@ -89,6 +90,7 @@ public class FullEntity
|
||||
/// </summary>
|
||||
private readonly ICollection<Getter> _getters =
|
||||
[
|
||||
new Getter<Action>(EntityType.Action, context => context.Actions),
|
||||
new Getter<Ancestry>(
|
||||
EntityType.Ancestry,
|
||||
context => context.Ancestries.Include(a => a.AncestryBoosts)
|
||||
@@ -121,15 +123,41 @@ public class FullEntity
|
||||
.Include(c => c.ClassProgressions)
|
||||
.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>(
|
||||
EntityType.Feat,
|
||||
context =>
|
||||
context.Feats.Include(f => f.Archetypes).ThenInclude(a => a.Entity).AsQueryable()
|
||||
),
|
||||
new Getter<Spell>(
|
||||
EntityType.Spell,
|
||||
context => context.Spells.Include(s => s.SpellAreas).Include(s => s.SpellDefenses)
|
||||
new Getter<Heritage>(
|
||||
EntityType.Heritage,
|
||||
context => context.Heritages.Include(h => h.Ancestry)
|
||||
),
|
||||
new Getter<Language>(EntityType.Language, context => context.Languages),
|
||||
new Getter<Ritual>(
|
||||
EntityType.Ritual,
|
||||
context =>
|
||||
@@ -139,6 +167,14 @@ public class FullEntity
|
||||
.ThenInclude(c => c.Training)
|
||||
.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>(
|
||||
EntityType.Subclass,
|
||||
context =>
|
||||
@@ -147,6 +183,7 @@ public class FullEntity
|
||||
.ThenInclude(t => t.Training)
|
||||
.Include(s => s.Entities)
|
||||
),
|
||||
new Getter<Trait>(EntityType.Trait, context => context.Traits),
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user