Большой рефактор

This commit is contained in:
2025-04-26 16:56:29 +04:00
parent 9d0683a23f
commit 76167f1b24
83 changed files with 943 additions and 864 deletions
+2 -1
View File
@@ -5,7 +5,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Action)]
public partial class Action : IEntity
public class Action : IEntity
{
[System.ComponentModel.DataAnnotations.Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -28,6 +28,7 @@ public partial class Action : IEntity
public bool IsPassive { get; set; } = false;
[Column(Order = 6)]
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
public string? Extra { get; set; }
public Entity Entity { get; set; } = null!;
+5 -5
View File
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Structure.AncestryRelation;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Ancestry)]
public partial class Ancestry : IEntity
public class Ancestry : IEntity
{
[System.ComponentModel.DataAnnotations.Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -27,11 +27,11 @@ public partial class Ancestry : IEntity
[Column(Order = 5)]
public AncestryVision Vision { get; set; } = AncestryVision.Normal;
public virtual ICollection<AncestryBoost> AncestryBoosts { get; set; } = [];
public ICollection<AncestryBoost> AncestryBoosts { get; set; } = [];
public virtual ICollection<AncestryItem> AncestryItems { get; set; } = [];
public ICollection<AncestryItem> AncestryItems { get; set; } = [];
public virtual ICollection<AncestryLanguage> AncestryLanguages { get; set; } = [];
public ICollection<AncestryLanguage> AncestryLanguages { get; set; } = [];
public virtual ICollection<Heritage> Heritages { get; set; } = [];
public ICollection<Heritage> Heritages { get; set; } = [];
}
@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Pf2eModel.Model.Structure.AncestryRelation;
public partial class AncestryBoost
public class AncestryBoost
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -21,5 +21,5 @@ public partial class AncestryBoost
public Enum.AttributeValues Value { get; set; }
[JsonIgnore]
public virtual Ancestry Ancestry { get; set; } = null!;
public Ancestry Ancestry { get; set; } = null!;
}
@@ -5,7 +5,7 @@ using Pf2eModel.Model.Base;
namespace Pf2eModel.Model.Structure.AncestryRelation;
[PrimaryKey(nameof(AncestryId), nameof(ItemId))]
public partial class AncestryItem
public class AncestryItem
{
[Column(Order = 1)]
public int AncestryId { get; set; }
@@ -16,7 +16,7 @@ public partial class AncestryItem
[Column(Order = 3)]
public int Level { get; set; }
public virtual Ancestry Ancestry { get; set; } = null!;
public Ancestry Ancestry { get; set; } = null!;
public virtual Entity Item { get; set; } = null!;
public Entity Item { get; set; } = null!;
}
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
namespace Pf2eModel.Model.Structure.AncestryRelation;
[PrimaryKey(nameof(AncestryId), nameof(LanguageId))]
public partial class AncestryLanguage
public class AncestryLanguage
{
[Column(Order = 1)]
public int AncestryId { get; set; }
@@ -15,7 +15,7 @@ public partial class AncestryLanguage
[Column(Order = 3)]
public bool IsAdditional { get; set; }
public virtual Ancestry Ancestry { get; set; } = null!;
public Ancestry Ancestry { get; set; } = null!;
public virtual Language Language { get; set; } = null!;
public Language Language { get; set; } = null!;
}
+2 -1
View File
@@ -21,9 +21,10 @@ public class Archetype : IEntity
public int? DedicationFeatId { get; set; } = null;
[Column(Order = 4)]
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
public string? Extra { get; set; }
public Feat DedicationFeat { get; set; } = null!;
public virtual ICollection<Feat> Feats { get; set; } = [];
public ICollection<Feat> Feats { get; set; } = [];
}
+4 -4
View File
@@ -7,7 +7,7 @@ using Pf2eModel.Model.Structure.BackgroundRelation;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Background)]
public partial class Background : IEntity
public class Background : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -16,9 +16,9 @@ public partial class Background : IEntity
public Entity Entity { get; set; } = null!;
public virtual ICollection<BackgroundBoost> BackgroundBoosts { get; set; } = [];
public ICollection<BackgroundBoost> BackgroundBoosts { get; set; } = [];
public virtual ICollection<BackgroundItem> BackgroundItems { get; set; } = [];
public ICollection<BackgroundItem> BackgroundItems { get; set; } = [];
public virtual ICollection<BackgroundTraining> BackgroundSkills { get; set; } = [];
public ICollection<BackgroundTraining> BackgroundSkills { get; set; } = [];
}
@@ -5,7 +5,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.BackgroundRelation;
public partial class BackgroundBoost
public class BackgroundBoost
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -19,5 +19,5 @@ public partial class BackgroundBoost
public AttributeValues Attribute { get; set; }
[JsonIgnore]
public virtual Background Background { get; set; } = null!;
public Background Background { get; set; } = null!;
}
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Base;
namespace Pf2eModel.Model.Structure.BackgroundRelation;
[PrimaryKey(nameof(BackgroundId), nameof(EntityId))]
public partial class BackgroundItem
public class BackgroundItem
{
[Column(Order = 1)]
public int BackgroundId { get; set; }
@@ -18,7 +18,7 @@ public partial class BackgroundItem
public int? Level { get; set; }
[JsonIgnore]
public virtual Background Background { get; set; } = null!;
public Background Background { get; set; } = null!;
public virtual Entity Entity { get; set; } = null!;
public Entity Entity { get; set; } = null!;
}
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.BackgroundRelation;
public partial class BackgroundTraining
public class BackgroundTraining
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -23,7 +23,7 @@ public partial class BackgroundTraining
public TrainingStage Level { get; set; }
[JsonIgnore]
public virtual Background Background { get; set; } = null!;
public Background Background { get; set; } = null!;
public virtual Training Training { get; set; } = null!;
public Training Training { get; set; } = null!;
}
@@ -5,7 +5,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.ClassRelation;
public partial class ClassKeyAbility
public class ClassKeyAbility
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -19,5 +19,5 @@ public partial class ClassKeyAbility
public AttributeValues Value { get; set; }
[JsonIgnore]
public virtual Class Class { get; set; } = null!;
public Class Class { get; set; } = null!;
}
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.ClassRelation;
public partial class ClassProgression
public class ClassProgression
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -26,7 +26,7 @@ public partial class ClassProgression
public int? EntityId { get; set; }
[JsonIgnore]
public virtual Class Class { get; set; } = null!;
public Class Class { get; set; } = null!;
public virtual Entity? Entity { get; set; }
public Entity? Entity { get; set; }
}
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.ClassRelation;
public partial class ClassTraining
public class ClassTraining
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -27,7 +27,7 @@ public partial class ClassTraining
public TrainingStage Stage { get; set; }
[JsonIgnore]
public virtual Class Class { get; set; } = null!;
public Class Class { get; set; } = null!;
public virtual Training? Training { get; set; }
public Training? Training { get; set; }
}
+2 -1
View File
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Condition)]
public partial class Condition : IEntity
public class Condition : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -19,5 +19,6 @@ public partial class Condition : IEntity
public ConditionGroup? Group { get; set; }
[Column(Order = 3)]
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
public string? Extra { get; set; }
}
+6 -7
View File
@@ -8,7 +8,7 @@ using Pf2eModel.Model.Structure.DeityRelation;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Deity)]
public partial class Deity : IEntity
public class Deity : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -29,14 +29,13 @@ public partial class Deity : IEntity
[Column(Order = 5)]
public bool SanctificationMust { get; set; }
public virtual ICollection<DeityAttribute> DeityAttributes { get; set; } =
new List<DeityAttribute>();
public ICollection<DeityAttribute> DeityAttributes { get; set; } = new List<DeityAttribute>();
public virtual ICollection<DeityDomain> DeityDomains { get; set; } = new List<DeityDomain>();
public ICollection<DeityDomain> DeityDomains { get; set; } = new List<DeityDomain>();
public virtual ICollection<DeitySpell> DeitySpells { get; set; } = new List<DeitySpell>();
public ICollection<DeitySpell> DeitySpells { get; set; } = new List<DeitySpell>();
public virtual ICollection<DeityWeapon> DeityWeapons { get; set; } = new List<DeityWeapon>();
public ICollection<DeityWeapon> DeityWeapons { get; set; } = new List<DeityWeapon>();
public virtual ICollection<Training> Skills { get; set; } = new List<Training>();
public ICollection<Training> Skills { get; set; } = new List<Training>();
}
@@ -5,7 +5,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.DeityRelation;
[PrimaryKey(nameof(DeityId), nameof(Attribute))]
public partial class DeityAttribute
public class DeityAttribute
{
[Column(Order = 1)]
public int DeityId { get; set; }
@@ -13,5 +13,5 @@ public partial class DeityAttribute
[Column(Order = 2)]
public AttributeValues Attribute { get; set; }
public virtual Deity Deity { get; set; } = null!;
public Deity Deity { get; set; } = null!;
}
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Pf2eModel.Model.Structure.DeityRelation;
public partial class DeityDomain
public class DeityDomain
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Pf2eModel.Model.Structure.DeityRelation;
public partial class DeitySpell
public class DeitySpell
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Pf2eModel.Model.Structure.DeityRelation;
public partial class DeityWeapon
public class DeityWeapon
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+4 -3
View File
@@ -7,7 +7,7 @@ using Pf2eModel.Model.Structure.FeatRelation;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Feat)]
public partial class Feat : IEntity
public class Feat : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -38,9 +38,10 @@ public partial class Feat : IEntity
public bool IsPassive { get; set; } = false;
[Column(Order = 10)]
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
public string? Extra { get; set; }
public virtual ICollection<Archetype> Archetypes { get; set; } = [];
public ICollection<Archetype> Archetypes { get; set; } = [];
public virtual ICollection<FeatPrerequisite> FeatPrerequisites { get; set; } = [];
public ICollection<FeatPrerequisite> FeatPrerequisites { get; set; } = [];
}
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Pf2eModel.Model.Structure.FeatRelation;
public partial class FeatPrerequisite
public class FeatPrerequisite
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+1 -1
View File
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Heritage)]
public partial class Heritage : IEntity
public class Heritage : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
+1 -1
View File
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Language)]
public partial class Language : IEntity
public class Language : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+1 -1
View File
@@ -7,7 +7,7 @@ using Pf2eModel.Model.Structure.SpellRelation;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Spell)]
public partial class Spell : IEntity
public class Spell : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -4,7 +4,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.SpellRelation;
public partial class SpellArea
public class SpellArea
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
@@ -4,7 +4,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure.SpellRelation;
public partial class SpellDamage
public class SpellDamage
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Pf2eModel.Model.Structure.SpellRelation;
public partial class SpellDefense
public class SpellDefense
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Pf2eModel.Model.Structure.SpellRelation;
public partial class SpellRitual
public class SpellRitual
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
+3 -1
View File
@@ -21,7 +21,9 @@ public class Subclass : IEntity
public SubclassGroup Group { get; set; } = null!;
[Column(Order = 3)]
public LocaleString Additional { get; set; } = new();
public LocaleString Additional { get; set; } = [];
[Column(Order = 4)]
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
public string Extra { get; set; } = "{}";
}
+2 -8
View File
@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Pf2eModel.Model.Base;
using Pf2eModel.Model.Enum;
using Pf2eModel.Model.Structure.ClassRelation;
namespace Pf2eModel.Model.Structure;
@@ -25,5 +19,5 @@ public class SubclassGroup : IEntity
public Class? Class { get; set; } = null!;
public virtual ICollection<Subclass> Subclasses { get; set; } = [];
public ICollection<Subclass> Subclasses { get; set; } = [];
}
+1 -1
View File
@@ -6,7 +6,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Structure;
[EntityOfType(EntityType.Trait)]
public partial class Trait : IEntity
public class Trait : IEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]