From 776abeb58a82cb4684a20491d81aa54ea832a5fa Mon Sep 17 00:00:00 2001 From: Ilya Kozhemyakin Date: Sat, 13 Sep 2025 11:39:23 +0400 Subject: [PATCH 1/5] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B3=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation/Pf2eModel/Class.Spellcasting.md | 6 ++-- Documentation/Pf2eModel/Class.md | 2 +- .../Pf2eModel/Pf2eModel.Model.Enum.md | 1 + Documentation/Pf2eModel/SpellcastingType.md | 29 +++++++++++++++++++ .../Aonprd/Processors/Types/ClassProcessor.cs | 4 --- ...signer.cs => 20250913071004_1.Designer.cs} | 20 ++++++++----- ...0250602061959_1.cs => 20250913071004_1.cs} | 9 +++--- .../Migrations/Pf2eDbContextModelSnapshot.cs | 18 ++++++++---- Pf2eModel/Model/Enum/SpellcastingType.cs | 27 +++++++++++++++++ Pf2eModel/Model/Structure/Class.cs | 6 ++-- 10 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 Documentation/Pf2eModel/SpellcastingType.md rename Pf2eModel/Migrations/{20250602061959_1.Designer.cs => 20250913071004_1.Designer.cs} (99%) rename Pf2eModel/Migrations/{20250602061959_1.cs => 20250913071004_1.cs} (99%) create mode 100644 Pf2eModel/Model/Enum/SpellcastingType.cs diff --git a/Documentation/Pf2eModel/Class.Spellcasting.md b/Documentation/Pf2eModel/Class.Spellcasting.md index 50af749..d960653 100644 --- a/Documentation/Pf2eModel/Class.Spellcasting.md +++ b/Documentation/Pf2eModel/Class.Spellcasting.md @@ -3,11 +3,11 @@ ## Class\.Spellcasting Property -Флаг, указывающий на то, что класс является заклинательным\. +Указание на тип заклинательства\. ```csharp -public bool Spellcasting { get; set; } +public Pf2eModel.Model.Enum.SpellcastingType Spellcasting { get; set; } ``` #### Property Value -[System\.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System\.Boolean') \ No newline at end of file +[SpellcastingType](SpellcastingType.md 'Pf2eModel\.Model\.Enum\.SpellcastingType') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Class.md b/Documentation/Pf2eModel/Class.md index e3c7114..14ca194 100644 --- a/Documentation/Pf2eModel/Class.md +++ b/Documentation/Pf2eModel/Class.md @@ -22,6 +22,6 @@ Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity') | [Entity](Class.Entity.md 'Pf2eModel\.Model\.Structure\.Class\.Entity') | Корневая сущность\. | | [Hp](Class.Hp.md 'Pf2eModel\.Model\.Structure\.Class\.Hp') | Количество очков здоровья\. | | [Id](Class.Id.md 'Pf2eModel\.Model\.Structure\.Class\.Id') | Идентификатор сущности\. | -| [Spellcasting](Class.Spellcasting.md 'Pf2eModel\.Model\.Structure\.Class\.Spellcasting') | Флаг, указывающий на то, что класс является заклинательным\. | +| [Spellcasting](Class.Spellcasting.md 'Pf2eModel\.Model\.Structure\.Class\.Spellcasting') | Указание на тип заклинательства\. | | [SubclassGroups](Class.SubclassGroups.md 'Pf2eModel\.Model\.Structure\.Class\.SubclassGroups') | Группы подклассов\. | | [Tradition](Class.Tradition.md 'Pf2eModel\.Model\.Structure\.Class\.Tradition') | Традиция заклинаний класса\. | diff --git a/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md b/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md index 45bce0b..58eb4e3 100644 --- a/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md +++ b/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md @@ -21,6 +21,7 @@ | [SizeEnum](SizeEnum.md 'Pf2eModel\.Model\.Enum\.SizeEnum') | Размер\. | | [SourceCategory](SourceCategory.md 'Pf2eModel\.Model\.Enum\.SourceCategory') | Перечисление категорий источников\. | | [SpellAreaType](SpellAreaType.md 'Pf2eModel\.Model\.Enum\.SpellAreaType') | Тип области заклинания\. | +| [SpellcastingType](SpellcastingType.md 'Pf2eModel\.Model\.Enum\.SpellcastingType') | Перечисление типа применения заклинаний\. | | [SpellDamageCategory](SpellDamageCategory.md 'Pf2eModel\.Model\.Enum\.SpellDamageCategory') | Тип урона заклинания\. | | [SpellDamageKinds](SpellDamageKinds.md 'Pf2eModel\.Model\.Enum\.SpellDamageKinds') | Тип урона заклинания\. | | [SpellTradition](SpellTradition.md 'Pf2eModel\.Model\.Enum\.SpellTradition') | Традиция заклинания\. | diff --git a/Documentation/Pf2eModel/SpellcastingType.md b/Documentation/Pf2eModel/SpellcastingType.md new file mode 100644 index 0000000..e298090 --- /dev/null +++ b/Documentation/Pf2eModel/SpellcastingType.md @@ -0,0 +1,29 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Enum](Pf2eModel.Model.Enum.md 'Pf2eModel\.Model\.Enum') + +## SpellcastingType Enum + +Перечисление типа применения заклинаний\. + +```csharp +public enum SpellcastingType +``` +### Fields + + + +`None` 0 + +Не применяет заклинания\. + + + +`Prepared` 1 + +Заготавливаемое заклинательство\. + + + +`Spontaneous` 2 + +Спонтанное заклинательство\. \ No newline at end of file diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs index a3db82f..7ce090a 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs @@ -7,7 +7,6 @@ using Pf2eDataScrapper.Helpers; using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; using Pf2eDataScrapper.Processors; using Pf2eDataScrapper.Processors.Attributes; -using Pf2eDataScrapper.Processors.Collection; using Pf2eModel; using Pf2eModel.Model.Common; using Pf2eModel.Model.Common.I18n; @@ -88,15 +87,12 @@ internal partial class ClassProcessor( switch (tradition.Count) { case 0: - Object.Spellcasting = false; Object.Tradition = SpellTradition.None; break; case 1: - Object.Spellcasting = true; Object.Tradition = Input.Enum(tradition[0].ToString()); break; default: - Object.Spellcasting = true; Object.Tradition = SpellTradition.All; break; } diff --git a/Pf2eModel/Migrations/20250602061959_1.Designer.cs b/Pf2eModel/Migrations/20250913071004_1.Designer.cs similarity index 99% rename from Pf2eModel/Migrations/20250602061959_1.Designer.cs rename to Pf2eModel/Migrations/20250913071004_1.Designer.cs index e93cd61..c30439f 100644 --- a/Pf2eModel/Migrations/20250602061959_1.Designer.cs +++ b/Pf2eModel/Migrations/20250913071004_1.Designer.cs @@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum; namespace Pf2eModel.Migrations { [DbContext(typeof(Pf2eDbContext))] - [Migration("20250602061959_1")] + [Migration("20250913071004_1")] partial class _1 { /// @@ -24,7 +24,7 @@ namespace Pf2eModel.Migrations .HasAnnotation("ProductVersion", "9.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "archetype", "army_tactic", "army_war_action", "class-feat", "class-feature", "defensive", "familiar", "interaction", "kingdom_activity", "kingdom_feat", "kingdom_feature", "offensive", "skill-action", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "archetype", "army_tactic", "army_war_action", "class-feat", "class-feature", "familiar", "kingdom_activity", "kingdom_feat", "kingdom_feature", "skill-action", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_enum", new[] { "1", "1 hour", "1 minute", "1-2", "1-3", "10 minutes", "2", "2-3", "2/2 rounds", "3", "30 minutes", "5 minutes", "free", "free/1", "other", "passive", "reaction", "reaction/1", "reaction/2", "reaction/3", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); @@ -134,13 +134,19 @@ namespace Pf2eModel.Migrations .HasColumnType("boolean") .HasColumnName("is_checked") .HasColumnOrder(9) - .HasComment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи"); + .HasComment("Проверено?"); + + b.Property("IsLegacy") + .HasColumnType("boolean") + .HasColumnName("is_legacy") + .HasColumnOrder(10) + .HasComment("Устаревшая?"); b.Property("IsTranslated") .HasColumnType("boolean") .HasColumnName("is_translated") .HasColumnOrder(8) - .HasComment("Флаг, указывающий, что у сущности существует перевод"); + .HasComment("Есть перевод?"); b.Property("Name") .IsRequired() @@ -890,11 +896,11 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Количество очков здоровья"); - b.Property("Spellcasting") - .HasColumnType("boolean") + b.Property("Spellcasting") + .HasColumnType("integer") .HasColumnName("spellcasting") .HasColumnOrder(3) - .HasComment("Заклинатель?"); + .HasComment("Тип заклинательства"); b.Property("Tradition") .HasColumnType("spell_tradition") diff --git a/Pf2eModel/Migrations/20250602061959_1.cs b/Pf2eModel/Migrations/20250913071004_1.cs similarity index 99% rename from Pf2eModel/Migrations/20250602061959_1.cs rename to Pf2eModel/Migrations/20250913071004_1.cs index 3fec90b..85c952c 100644 --- a/Pf2eModel/Migrations/20250602061959_1.cs +++ b/Pf2eModel/Migrations/20250913071004_1.cs @@ -14,7 +14,7 @@ namespace Pf2eModel.Migrations protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() - .Annotation("Npgsql:Enum:action_category", "archetype,army_tactic,army_war_action,class-feat,class-feature,defensive,familiar,interaction,kingdom_activity,kingdom_feat,kingdom_feature,offensive,skill-action,unknown") + .Annotation("Npgsql:Enum:action_category", "archetype,army_tactic,army_war_action,class-feat,class-feature,familiar,kingdom_activity,kingdom_feat,kingdom_feature,skill-action,unknown") .Annotation("Npgsql:Enum:action_enum", "1,1 hour,1 minute,1-2,1-3,10 minutes,2,2-3,2/2 rounds,3,30 minutes,5 minutes,free,free/1,other,passive,reaction,reaction/1,reaction/2,reaction/3,unknown") .Annotation("Npgsql:Enum:attribute_values", "cha,con,dex,free,int,str,wis") .Annotation("Npgsql:Enum:class_progression_type", "ancestry_feat,attribute_increase,class_feat,entity,general_feat,skill_feat,skill_increase") @@ -49,8 +49,9 @@ namespace Pf2eModel.Migrations img = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Изображение объекта"), description = table.Column(type: "text", nullable: false, comment: "Текстовое описание сущности"), rarity = table.Column(type: "entity_rarity", nullable: false, comment: "Редкость сущности"), - is_translated = table.Column(type: "boolean", nullable: true, comment: "Флаг, указывающий, что у сущности существует перевод"), - is_checked = table.Column(type: "boolean", nullable: true, comment: "Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи") + is_translated = table.Column(type: "boolean", nullable: true, comment: "Есть перевод?"), + is_checked = table.Column(type: "boolean", nullable: true, comment: "Проверено?"), + is_legacy = table.Column(type: "boolean", nullable: true, comment: "Устаревшая?") }, constraints: table => { @@ -194,7 +195,7 @@ namespace Pf2eModel.Migrations { id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), hp = table.Column(type: "integer", nullable: false, comment: "Количество очков здоровья"), - spellcasting = table.Column(type: "boolean", nullable: false, comment: "Заклинатель?"), + spellcasting = table.Column(type: "integer", nullable: false, comment: "Тип заклинательства"), tradition = table.Column(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"), additional_trained_skills = table.Column(type: "integer", nullable: false, comment: "Дополнительные навыки") }, diff --git a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs index 8b39b72..288db0a 100644 --- a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs +++ b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs @@ -21,7 +21,7 @@ namespace Pf2eModel.Migrations .HasAnnotation("ProductVersion", "9.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "archetype", "army_tactic", "army_war_action", "class-feat", "class-feature", "defensive", "familiar", "interaction", "kingdom_activity", "kingdom_feat", "kingdom_feature", "offensive", "skill-action", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "archetype", "army_tactic", "army_war_action", "class-feat", "class-feature", "familiar", "kingdom_activity", "kingdom_feat", "kingdom_feature", "skill-action", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_enum", new[] { "1", "1 hour", "1 minute", "1-2", "1-3", "10 minutes", "2", "2-3", "2/2 rounds", "3", "30 minutes", "5 minutes", "free", "free/1", "other", "passive", "reaction", "reaction/1", "reaction/2", "reaction/3", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); @@ -131,13 +131,19 @@ namespace Pf2eModel.Migrations .HasColumnType("boolean") .HasColumnName("is_checked") .HasColumnOrder(9) - .HasComment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи"); + .HasComment("Проверено?"); + + b.Property("IsLegacy") + .HasColumnType("boolean") + .HasColumnName("is_legacy") + .HasColumnOrder(10) + .HasComment("Устаревшая?"); b.Property("IsTranslated") .HasColumnType("boolean") .HasColumnName("is_translated") .HasColumnOrder(8) - .HasComment("Флаг, указывающий, что у сущности существует перевод"); + .HasComment("Есть перевод?"); b.Property("Name") .IsRequired() @@ -887,11 +893,11 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Количество очков здоровья"); - b.Property("Spellcasting") - .HasColumnType("boolean") + b.Property("Spellcasting") + .HasColumnType("integer") .HasColumnName("spellcasting") .HasColumnOrder(3) - .HasComment("Заклинатель?"); + .HasComment("Тип заклинательства"); b.Property("Tradition") .HasColumnType("spell_tradition") diff --git a/Pf2eModel/Model/Enum/SpellcastingType.cs b/Pf2eModel/Model/Enum/SpellcastingType.cs new file mode 100644 index 0000000..6355762 --- /dev/null +++ b/Pf2eModel/Model/Enum/SpellcastingType.cs @@ -0,0 +1,27 @@ +using NpgsqlTypes; + +namespace Pf2eModel.Model.Enum; + +/// +/// Перечисление типа применения заклинаний. +/// +public enum SpellcastingType +{ + /// + /// Не применяет заклинания. + /// + [PgName("none")] + None, + + /// + /// Заготавливаемое заклинательство. + /// + [PgName("prepared")] + Prepared, + + /// + /// Спонтанное заклинательство. + /// + [PgName("spontaneous")] + Spontaneous, +} diff --git a/Pf2eModel/Model/Structure/Class.cs b/Pf2eModel/Model/Structure/Class.cs index 766b1b9..8307f47 100644 --- a/Pf2eModel/Model/Structure/Class.cs +++ b/Pf2eModel/Model/Structure/Class.cs @@ -31,11 +31,11 @@ public class Class : IEntity public int Hp { get; set; } /// - /// Флаг, указывающий на то, что класс является заклинательным. + /// Указание на тип заклинательства. /// [Column(Order = 3)] - [Comment("Заклинатель?")] - public bool Spellcasting { get; set; } + [Comment("Тип заклинательства")] + public SpellcastingType Spellcasting { get; set; } = SpellcastingType.None; /// /// Традиция заклинаний класса. From 8290183220ce6b426115f18a079a88886820edab Mon Sep 17 00:00:00 2001 From: Ilya Kozhemyakin Date: Sat, 13 Sep 2025 12:06:56 +0400 Subject: [PATCH 2/5] =?UTF-8?q?=D0=A1=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pf2eModel/Model/Enum/EntityType.cs | 6 ++ .../Structure/DeityRelation/DeityDomain.cs | 15 +++- Pf2eModel/Model/Structure/Domain.cs | 86 +++++++++++++++++++ Pf2eModel/Pf2eDbContext.cs | 2 + Pf2eModel/Pf2eDbContextModel.cs | 41 ++++++++- 5 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 Pf2eModel/Model/Structure/Domain.cs diff --git a/Pf2eModel/Model/Enum/EntityType.cs b/Pf2eModel/Model/Enum/EntityType.cs index b3aa3d5..bb72622 100644 --- a/Pf2eModel/Model/Enum/EntityType.cs +++ b/Pf2eModel/Model/Enum/EntityType.cs @@ -79,6 +79,12 @@ public enum EntityType [PgName("condition")] Condition, + /// + /// Домен божества. + /// + [PgName("domain")] + Domain, + /// /// Божество. /// diff --git a/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs b/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs index 6d693d1..c6d29a6 100644 --- a/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs +++ b/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; +using Pf2eModel.Model.Structure; namespace Pf2eModel.Model.Structure.DeityRelation; @@ -25,6 +26,13 @@ public class DeityDomain [Comment("Идентификатор божества")] public int DeityId { get; set; } + /// + /// Идентификатор домена. + /// + [Column(Order = 4)] + [Comment("Идентификатор домена")] + public int DomainId { get; set; } + /// /// Флаг, указывающий, является ли домен основным для божества. /// @@ -35,7 +43,7 @@ public class DeityDomain /// /// Значение домена божества, например, "Свет", "Тьма" и т.д. /// - [Column(Order = 4)] + [Column(Order = 5)] [MaxLength(Pf2eDbContext.NameLength)] public string Value { get; set; } = null!; @@ -43,4 +51,9 @@ public class DeityDomain /// Божество, к которому относится домен. /// public virtual Deity Deity { get; set; } = null!; + + /// + /// Домен, связанный с божеством. + /// + public virtual Domain Domain { get; set; } = null!; } diff --git a/Pf2eModel/Model/Structure/Domain.cs b/Pf2eModel/Model/Structure/Domain.cs new file mode 100644 index 0000000..b783f57 --- /dev/null +++ b/Pf2eModel/Model/Structure/Domain.cs @@ -0,0 +1,86 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; +using Pf2eModel.Model.Base; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure.DeityRelation; + +namespace Pf2eModel.Model.Structure; + +/// +/// Домен. +/// +[EntityOfType(EntityType.Domain)] +public class Domain : IEntity +{ + /// + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + [Column(Order = 1)] + [Comment("Идентификатор")] + public int Id { get; set; } + + /// + public Entity Entity { get; set; } = null!; + + /// + /// Название домена. + /// + [Column(Order = 2)] + [MaxLength(Pf2eDbContext.NameLength)] + [Comment("Название домена")] + public string Name { get; set; } = null!; + + /// + /// Идентификатор заклинания домена. + /// + [Column(Order = 3)] + [Comment("Идентификатор заклинания домена")] + public int DomainSpellId { get; set; } + + /// + /// Идентификатор продвинутого заклинания домена. + /// + [Column(Order = 4)] + [Comment("Идентификатор продвинутого заклинания домена")] + public int AdvancedDomainSpellId { get; set; } + + /// + /// Идентификатор апокрифического заклинания домена. + /// + [Column(Order = 5)] + [Comment("Идентификатор апокрифического заклинания домена")] + public int? ApocryphalSpellId { get; set; } + + /// + /// Идентификатор продвинутого апокрифического заклинания домена. + /// + [Column(Order = 6)] + [Comment("Идентификатор продвинутого апокрифического заклинания домена")] + public int? AdvancedApocryphalSpellId { get; set; } + + /// + /// Заклинание домена. + /// + public virtual Spell DomainSpell { get; set; } = null!; + + /// + /// Продвинутое заклинание домена. + /// + public virtual Spell AdvancedDomainSpell { get; set; } = null!; + + /// + /// Апокрифическое заклинание домена. + /// + public virtual Spell? ApocryphalSpell { get; set; } + + /// + /// Продвинутое апокрифическое заклинание домена. + /// + public virtual Spell? AdvancedApocryphalSpell { get; set; } + + /// + /// Связи с божествами, которые используют этот домен. + /// + public virtual ICollection DeityDomains { get; set; } = new List(); +} diff --git a/Pf2eModel/Pf2eDbContext.cs b/Pf2eModel/Pf2eDbContext.cs index 4d314e8..442853a 100644 --- a/Pf2eModel/Pf2eDbContext.cs +++ b/Pf2eModel/Pf2eDbContext.cs @@ -89,6 +89,8 @@ public partial class Pf2eDbContext : DbContext public virtual DbSet DeityWeapons { get; set; } + public virtual DbSet Domains { get; set; } + public virtual DbSet Entities { get; set; } public virtual DbSet EntityAliases { get; set; } diff --git a/Pf2eModel/Pf2eDbContextModel.cs b/Pf2eModel/Pf2eDbContextModel.cs index f203006..d94525a 100644 --- a/Pf2eModel/Pf2eDbContextModel.cs +++ b/Pf2eModel/Pf2eDbContextModel.cs @@ -393,6 +393,42 @@ public partial class Pf2eDbContext BindEntity(entity); }); + // Domain + modelBuilder.Entity(entity => + { + BindEntity(entity); + + entity + .HasOne(d => d.DomainSpell) + .WithMany() + .HasForeignKey(d => d.DomainSpellId) + .OnDelete(DeleteBehavior.Cascade); + + entity + .HasOne(d => d.AdvancedDomainSpell) + .WithMany() + .HasForeignKey(d => d.AdvancedDomainSpellId) + .OnDelete(DeleteBehavior.Cascade); + + entity + .HasOne(d => d.ApocryphalSpell) + .WithMany() + .HasForeignKey(d => d.ApocryphalSpellId) + .OnDelete(DeleteBehavior.SetNull); + + entity + .HasOne(d => d.AdvancedApocryphalSpell) + .WithMany() + .HasForeignKey(d => d.AdvancedApocryphalSpellId) + .OnDelete(DeleteBehavior.SetNull); + + entity + .HasMany(d => d.DeityDomains) + .WithOne(dd => dd.Domain) + .HasForeignKey(dd => dd.DomainId) + .OnDelete(DeleteBehavior.Cascade); + }); + // Deity modelBuilder.Entity(entity => { @@ -425,7 +461,10 @@ public partial class Pf2eDbContext entity.HasMany(e => e.Skills).WithMany(); }); modelBuilder.Entity(entity => { }); - modelBuilder.Entity(entity => { }); + modelBuilder.Entity(entity => + { + // Связь теперь настроена в конфигурации Domain + }); modelBuilder.Entity(entity => { entity From 90597560c5bc0be5a7296d72c02a49e913f84d2a Mon Sep 17 00:00:00 2001 From: Ilya Kozhemyakin Date: Sat, 13 Sep 2025 16:48:44 +0400 Subject: [PATCH 3/5] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D0=BE=D1=80=20=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractEntityProcessor.md | 2 + .../AonprdBuilderGlobals.Ignore.md | 13 + .../Pf2eDataScrapper/AonprdBuilderGlobals.md | 1 + .../Pf2eDataScrapper/DeityProcessor.Add().md | 10 + .../DeityProcessor.MarkdownLinkRegex().md | 28 ++ .../Pf2eDataScrapper/DeityProcessor.Object.md | 13 + .../DeityProcessor.Process().md | 12 + .../DeityProcessor.ProcessAttributes().md | 10 + ...ssor.ProcessDomainMarkdown(string,bool).md | 23 ++ .../DeityProcessor.ProcessDomains().md | 10 + .../DeityProcessor.ProcessFonts().md | 10 + .../DeityProcessor.ProcessSanctification().md | 10 + .../DeityProcessor.ProcessSkills().md | 10 + .../DeityProcessor.ProcessSpells().md | 10 + .../DeityProcessor.ProcessWeapons().md | 10 + .../Pf2eDataScrapper/DeityProcessor.Type.md | 13 + .../Pf2eDataScrapper/DeityProcessor.md | 29 ++ .../Pf2eDataScrapper/DomainProcessor.Add().md | 10 + ...rocessor.GetSpellIdFromMarkdown(string).md | 21 ++ .../DomainProcessor.MarkdownLinkRegex().md | 28 ++ .../DomainProcessor.Object.md | 13 + .../DomainProcessor.Process().md | 12 + .../DomainProcessor.ProcessDomainSpells().md | 10 + .../Pf2eDataScrapper/DomainProcessor.Type.md | 13 + .../Pf2eDataScrapper/DomainProcessor.md | 23 ++ ...Implementations.Aonprd.Processors.Types.md | 2 + Documentation/Pf2eModel/DeityDomain.Domain.md | 13 + .../Pf2eModel/DeityDomain.DomainId.md | 13 + Documentation/Pf2eModel/DeityDomain.md | 2 + .../Domain.AdvancedApocryphalSpell.md | 13 + .../Domain.AdvancedApocryphalSpellId.md | 13 + .../Pf2eModel/Domain.AdvancedDomainSpell.md | 13 + .../Pf2eModel/Domain.AdvancedDomainSpellId.md | 13 + .../Pf2eModel/Domain.ApocryphalSpell.md | 13 + .../Pf2eModel/Domain.ApocryphalSpellId.md | 13 + .../Pf2eModel/Domain.DeityDomains.md | 13 + Documentation/Pf2eModel/Domain.DomainSpell.md | 13 + .../Pf2eModel/Domain.DomainSpellId.md | 13 + Documentation/Pf2eModel/Domain.Entity.md | 15 ++ Documentation/Pf2eModel/Domain.Id.md | 15 ++ Documentation/Pf2eModel/Domain.md | 28 ++ Documentation/Pf2eModel/EntityType.md | 20 +- Documentation/Pf2eModel/IEntity.md | 1 + .../Pf2eModel/Pf2eModel.Model.Structure.md | 1 + Documentation/Pf2eModel/TraitType.md | 10 +- .../Aonprd/Helpers/AonprdBuilderGlobals.cs | 7 + .../Processors/AbstractEntityProcessor.cs | 11 +- .../Aonprd/Processors/Types/DeityProcessor.cs | 247 ++++++++++++++++++ .../Processors/Types/DomainProcessor.cs | 119 +++++++++ .../Resources/ImportAdaptation.json | 3 + ...signer.cs => 20250913084534_1.Designer.cs} | 125 ++++++++- ...0250913071004_1.cs => 20250913084534_1.cs} | 130 +++++++-- .../Migrations/Pf2eDbContextModelSnapshot.cs | 123 ++++++++- Pf2eModel/Model/Enum/TraitType.cs | 6 + Pf2eModel/Model/Structure/Domain.cs | 24 +- 55 files changed, 1319 insertions(+), 57 deletions(-) create mode 100644 Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.Add().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.Object.md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.Process().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.Type.md create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.Add().md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.Object.md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.Process().md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.Type.md create mode 100644 Documentation/Pf2eDataScrapper/DomainProcessor.md create mode 100644 Documentation/Pf2eModel/DeityDomain.Domain.md create mode 100644 Documentation/Pf2eModel/DeityDomain.DomainId.md create mode 100644 Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md create mode 100644 Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md create mode 100644 Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md create mode 100644 Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md create mode 100644 Documentation/Pf2eModel/Domain.ApocryphalSpell.md create mode 100644 Documentation/Pf2eModel/Domain.ApocryphalSpellId.md create mode 100644 Documentation/Pf2eModel/Domain.DeityDomains.md create mode 100644 Documentation/Pf2eModel/Domain.DomainSpell.md create mode 100644 Documentation/Pf2eModel/Domain.DomainSpellId.md create mode 100644 Documentation/Pf2eModel/Domain.Entity.md create mode 100644 Documentation/Pf2eModel/Domain.Id.md create mode 100644 Documentation/Pf2eModel/Domain.md create mode 100644 Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs create mode 100644 Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs rename Pf2eModel/Migrations/{20250913071004_1.Designer.cs => 20250913084534_1.Designer.cs} (95%) rename Pf2eModel/Migrations/{20250913071004_1.cs => 20250913084534_1.cs} (95%) diff --git a/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md b/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md index eecf028..2e23884 100644 --- a/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md +++ b/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md @@ -20,6 +20,8 @@ Derived ↳ [ArchetypeProcessor](ArchetypeProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ArchetypeProcessor') ↳ [BackgroundProcessor](BackgroundProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.BackgroundProcessor') ↳ [ClassProcessor](ClassProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ClassProcessor') +↳ [DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') +↳ [DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') ↳ [FeatProcessor](FeatProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.FeatProcessor') ↳ [HeritageProcessor](HeritageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.HeritageProcessor') ↳ [LanguageProcessor](LanguageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.LanguageProcessor') diff --git a/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md new file mode 100644 index 0000000..15714cc --- /dev/null +++ b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers](Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers').[AonprdBuilderGlobals](AonprdBuilderGlobals.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals') + +## AonprdBuilderGlobals\.Ignore Property + +Список идентификаторов сущностей, которые нужно игнорировать при обработке\. + +```csharp +public System.Collections.Generic.List Ignore { get; } +``` + +#### Property Value +[System\.Collections\.Generic\.List<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.List-1 'System\.Collections\.Generic\.List\`1')[System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.List-1 'System\.Collections\.Generic\.List\`1') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md index 0ee21b8..472a542 100644 --- a/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md +++ b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md @@ -18,6 +18,7 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | Properties | | | :--- | :--- | | [AonprdTarget](AonprdBuilderGlobals.AonprdTarget.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.AonprdTarget') | Цель внешних ссылок Архивов Нефисов\. | +| [Ignore](AonprdBuilderGlobals.Ignore.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.Ignore') | Список идентификаторов сущностей, которые нужно игнорировать при обработке\. | | [LegacyRemasterExtra](AonprdBuilderGlobals.LegacyRemasterExtra.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.LegacyRemasterExtra') | Словарь допольнительных проверок связей\. Ключ \- устаревшая сущность, значение \- обновлённая\. | | [MergeSources](AonprdBuilderGlobals.MergeSources.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.MergeSources') | Словарь сущностей, которые нужно слить с другой/другими\. Ключ \- пропускаемая сущность\. Значение \- целевая сущность\. | | [SlugSuffixes](AonprdBuilderGlobals.SlugSuffixes.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.SlugSuffixes') | Словарей суффиксов для сущностей | diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Add().md b/Documentation/Pf2eDataScrapper/DeityProcessor.Add().md new file mode 100644 index 0000000..53e3815 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Add().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Add\(\) Method + +Добавление основной сущности в контекст базы данных\. + +```csharp +protected override void Add(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md b/Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md new file mode 100644 index 0000000..6117686 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md @@ -0,0 +1,28 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.MarkdownLinkRegex\(\) Method + +```csharp +private static System.Text.RegularExpressions.Regex MarkdownLinkRegex(); +``` + +#### Returns +[System\.Text\.RegularExpressions\.Regex](https://docs.microsoft.com/en-us/dotnet/api/System.Text.RegularExpressions.Regex 'System\.Text\.RegularExpressions\.Regex') + +### Remarks +Pattern:
+ +```csharp +\\[([^\\]]+)\\]\\([^)]+\\) +```
+Explanation:
+ +```csharp +○ Match '['.
+○ 1st capture group.
+ ○ Match a character other than ']' atomically at least once.
+○ Match the string "](".
+○ Match a character other than ')' atomically at least once.
+○ Match ')'.
+``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Object.md b/Documentation/Pf2eDataScrapper/DeityProcessor.Object.md new file mode 100644 index 0000000..fe58ea6 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Object.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Object Property + +Основная сущность\. + +```csharp +public virtual Pf2eModel.Model.Structure.Deity Object { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Structure\.Deity](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Structure.Deity 'Pf2eModel\.Model\.Structure\.Deity') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Process().md b/Documentation/Pf2eDataScrapper/DeityProcessor.Process().md new file mode 100644 index 0000000..122f4c4 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Process().md @@ -0,0 +1,12 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Process\(\) Method + +Основной метод обработки данных\. + +```csharp +public override void Process(); +``` + +Implements [Process\(\)](IProcessor.Process().md 'Pf2eDataScrapper\.Processors\.Definitions\.IProcessor\.Process\(\)') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md new file mode 100644 index 0000000..7f26201 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessAttributes\(\) Method + +Обработка атрибутов божества\. + +```csharp +private void ProcessAttributes(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md new file mode 100644 index 0000000..3387c04 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md @@ -0,0 +1,23 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessDomainMarkdown\(string, bool\) Method + +Обработка markdown\-строки с доменами\. + +```csharp +private void ProcessDomainMarkdown(string markdown, bool isPrimary); +``` +#### Parameters + + + +`markdown` [System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String') + +Markdown\-строка с доменами\. + + + +`isPrimary` [System\.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System\.Boolean') + +Флаг, указывающий, являются ли домены основными\. \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md new file mode 100644 index 0000000..fe0752f --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessDomains\(\) Method + +Обработка доменов божества\. + +```csharp +private void ProcessDomains(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md new file mode 100644 index 0000000..00b7312 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessFonts\(\) Method + +Обработка божественной силы\. + +```csharp +private void ProcessFonts(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md new file mode 100644 index 0000000..714a0b7 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessSanctification\(\) Method + +Обработка освящения\. + +```csharp +private void ProcessSanctification(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md new file mode 100644 index 0000000..66e0991 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessSkills\(\) Method + +Обработка навыков божества\. + +```csharp +private void ProcessSkills(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md new file mode 100644 index 0000000..96509de --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessSpells\(\) Method + +Обработка заклинаний божества\. + +```csharp +private void ProcessSpells(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md new file mode 100644 index 0000000..37aadd1 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessWeapons\(\) Method + +Обработка оружия божества\. + +```csharp +private void ProcessWeapons(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Type.md b/Documentation/Pf2eDataScrapper/DeityProcessor.Type.md new file mode 100644 index 0000000..666cb6b --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Type.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Type Property + +Тип сущности\. + +```csharp +public override Pf2eModel.Model.Enum.EntityType Type { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Enum\.EntityType](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Enum.EntityType 'Pf2eModel\.Model\.Enum\.EntityType') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.md b/Documentation/Pf2eDataScrapper/DeityProcessor.md new file mode 100644 index 0000000..ece2701 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.md @@ -0,0 +1,29 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types') + +## DeityProcessor Class + +```csharp +internal class DeityProcessor : Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.AbstractEntityProcessor +``` + +Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 [AbstractInputProcessor](AbstractInputProcessor.md 'Pf2eDataScrapper\.Processors\.Definitions\.AbstractInputProcessor') 🡒 [AbstractEntityProcessor](AbstractEntityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.AbstractEntityProcessor') 🡒 DeityProcessor + +| Properties | | +| :--- | :--- | +| [Object](DeityProcessor.Object.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Object') | Основная сущность\. | +| [Type](DeityProcessor.Type.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Type') | Тип сущности\. | + +| Methods | | +| :--- | :--- | +| [Add\(\)](DeityProcessor.Add().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Add\(\)') | Добавление основной сущности в контекст базы данных\. | +| [MarkdownLinkRegex\(\)](DeityProcessor.MarkdownLinkRegex().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.MarkdownLinkRegex\(\)') | | +| [Process\(\)](DeityProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Process\(\)') | Основной метод обработки данных\. | +| [ProcessAttributes\(\)](DeityProcessor.ProcessAttributes().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessAttributes\(\)') | Обработка атрибутов божества\. | +| [ProcessDomainMarkdown\(string, bool\)](DeityProcessor.ProcessDomainMarkdown(string,bool).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomainMarkdown\(string, bool\)') | Обработка markdown\-строки с доменами\. | +| [ProcessDomains\(\)](DeityProcessor.ProcessDomains().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomains\(\)') | Обработка доменов божества\. | +| [ProcessFonts\(\)](DeityProcessor.ProcessFonts().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessFonts\(\)') | Обработка божественной силы\. | +| [ProcessSanctification\(\)](DeityProcessor.ProcessSanctification().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSanctification\(\)') | Обработка освящения\. | +| [ProcessSkills\(\)](DeityProcessor.ProcessSkills().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSkills\(\)') | Обработка навыков божества\. | +| [ProcessSpells\(\)](DeityProcessor.ProcessSpells().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSpells\(\)') | Обработка заклинаний божества\. | +| [ProcessWeapons\(\)](DeityProcessor.ProcessWeapons().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessWeapons\(\)') | Обработка оружия божества\. | diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Add().md b/Documentation/Pf2eDataScrapper/DomainProcessor.Add().md new file mode 100644 index 0000000..d8faf07 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Add().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Add\(\) Method + +Добавление основной сущности в контекст базы данных\. + +```csharp +protected override void Add(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md b/Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md new file mode 100644 index 0000000..998ccf7 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md @@ -0,0 +1,21 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.GetSpellIdFromMarkdown\(string\) Method + +Получение идентификатора заклинания из markdown\-строки\. + +```csharp +private int GetSpellIdFromMarkdown(string markdown); +``` +#### Parameters + + + +`markdown` [System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String') + +Markdown\-строка с информацией о заклинании\. + +#### Returns +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') +Идентификатор заклинания\. \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md b/Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md new file mode 100644 index 0000000..7247162 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md @@ -0,0 +1,28 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.MarkdownLinkRegex\(\) Method + +```csharp +private static System.Text.RegularExpressions.Regex MarkdownLinkRegex(); +``` + +#### Returns +[System\.Text\.RegularExpressions\.Regex](https://docs.microsoft.com/en-us/dotnet/api/System.Text.RegularExpressions.Regex 'System\.Text\.RegularExpressions\.Regex') + +### Remarks +Pattern:
+ +```csharp +\\[([^\\]]+)\\]\\([^)]+\\) +```
+Explanation:
+ +```csharp +○ Match '['.
+○ 1st capture group.
+ ○ Match a character other than ']' atomically at least once.
+○ Match the string "](".
+○ Match a character other than ')' atomically at least once.
+○ Match ')'.
+``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Object.md b/Documentation/Pf2eDataScrapper/DomainProcessor.Object.md new file mode 100644 index 0000000..3a40e65 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Object.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Object Property + +Основная сущность\. + +```csharp +public virtual Pf2eModel.Model.Structure.Domain Object { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Structure\.Domain](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Structure.Domain 'Pf2eModel\.Model\.Structure\.Domain') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Process().md b/Documentation/Pf2eDataScrapper/DomainProcessor.Process().md new file mode 100644 index 0000000..ac5d519 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Process().md @@ -0,0 +1,12 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Process\(\) Method + +Основной метод обработки данных\. + +```csharp +public override void Process(); +``` + +Implements [Process\(\)](IProcessor.Process().md 'Pf2eDataScrapper\.Processors\.Definitions\.IProcessor\.Process\(\)') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md b/Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md new file mode 100644 index 0000000..70f82ae --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.ProcessDomainSpells\(\) Method + +Обработка заклинаний, связанных с доменом\. + +```csharp +private void ProcessDomainSpells(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Type.md b/Documentation/Pf2eDataScrapper/DomainProcessor.Type.md new file mode 100644 index 0000000..efed438 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Type.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Type Property + +Тип сущности\. + +```csharp +public override Pf2eModel.Model.Enum.EntityType Type { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Enum\.EntityType](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Enum.EntityType 'Pf2eModel\.Model\.Enum\.EntityType') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.md b/Documentation/Pf2eDataScrapper/DomainProcessor.md new file mode 100644 index 0000000..0d616dd --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.md @@ -0,0 +1,23 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types') + +## DomainProcessor Class + +```csharp +internal class DomainProcessor : Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.AbstractEntityProcessor +``` + +Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 [AbstractInputProcessor](AbstractInputProcessor.md 'Pf2eDataScrapper\.Processors\.Definitions\.AbstractInputProcessor') 🡒 [AbstractEntityProcessor](AbstractEntityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.AbstractEntityProcessor') 🡒 DomainProcessor + +| Properties | | +| :--- | :--- | +| [Object](DomainProcessor.Object.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Object') | Основная сущность\. | +| [Type](DomainProcessor.Type.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Type') | Тип сущности\. | + +| Methods | | +| :--- | :--- | +| [Add\(\)](DomainProcessor.Add().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Add\(\)') | Добавление основной сущности в контекст базы данных\. | +| [GetSpellIdFromMarkdown\(string\)](DomainProcessor.GetSpellIdFromMarkdown(string).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.GetSpellIdFromMarkdown\(string\)') | Получение идентификатора заклинания из markdown\-строки\. | +| [MarkdownLinkRegex\(\)](DomainProcessor.MarkdownLinkRegex().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.MarkdownLinkRegex\(\)') | | +| [Process\(\)](DomainProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Process\(\)') | Основной метод обработки данных\. | +| [ProcessDomainSpells\(\)](DomainProcessor.ProcessDomainSpells().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.ProcessDomainSpells\(\)') | Обработка заклинаний, связанных с доменом\. | diff --git a/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md b/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md index 03f2a85..8c51b04 100644 --- a/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md +++ b/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md @@ -11,6 +11,8 @@ | [ArchetypeProcessor](ArchetypeProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ArchetypeProcessor') | | | [BackgroundProcessor](BackgroundProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.BackgroundProcessor') | | | [ClassProcessor](ClassProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ClassProcessor') | | +| [DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') | | +| [DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') | | | [FeatProcessor](FeatProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.FeatProcessor') | | | [HeritageProcessor](HeritageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.HeritageProcessor') | | | [LanguageProcessor](LanguageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.LanguageProcessor') | | diff --git a/Documentation/Pf2eModel/DeityDomain.Domain.md b/Documentation/Pf2eModel/DeityDomain.Domain.md new file mode 100644 index 0000000..048533b --- /dev/null +++ b/Documentation/Pf2eModel/DeityDomain.Domain.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure\.DeityRelation](Pf2eModel.Model.Structure.DeityRelation.md 'Pf2eModel\.Model\.Structure\.DeityRelation').[DeityDomain](DeityDomain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain') + +## DeityDomain\.Domain Property + +Домен, связанный с божеством\. + +```csharp +public virtual Pf2eModel.Model.Structure.Domain Domain { get; set; } +``` + +#### Property Value +[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityDomain.DomainId.md b/Documentation/Pf2eModel/DeityDomain.DomainId.md new file mode 100644 index 0000000..3e90ac3 --- /dev/null +++ b/Documentation/Pf2eModel/DeityDomain.DomainId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure\.DeityRelation](Pf2eModel.Model.Structure.DeityRelation.md 'Pf2eModel\.Model\.Structure\.DeityRelation').[DeityDomain](DeityDomain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain') + +## DeityDomain\.DomainId Property + +Идентификатор домена\. + +```csharp +public int DomainId { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityDomain.md b/Documentation/Pf2eModel/DeityDomain.md index b7bcfb1..3a7ebd9 100644 --- a/Documentation/Pf2eModel/DeityDomain.md +++ b/Documentation/Pf2eModel/DeityDomain.md @@ -15,6 +15,8 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | :--- | :--- | | [Deity](DeityDomain.Deity.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Deity') | Божество, к которому относится домен\. | | [DeityId](DeityDomain.DeityId.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.DeityId') | Идентификатор божества, к которому относится домен\. | +| [Domain](DeityDomain.Domain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Domain') | Домен, связанный с божеством\. | +| [DomainId](DeityDomain.DomainId.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.DomainId') | Идентификатор домена\. | | [Id](DeityDomain.Id.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Id') | Идентификатор отношения божества и домена\. | | [IsPrimary](DeityDomain.IsPrimary.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.IsPrimary') | Флаг, указывающий, является ли домен основным для божества\. | | [Value](DeityDomain.Value.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Value') | Значение домена божества, например, "Свет", "Тьма" и т\.д\. | diff --git a/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md new file mode 100644 index 0000000..c8534fc --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedApocryphalSpell Property + +Продвинутое апокрифическое заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell? AdvancedApocryphalSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md new file mode 100644 index 0000000..f1fab1a --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedApocryphalSpellId Property + +Идентификатор продвинутого апокрифического заклинания домена\. + +```csharp +public System.Nullable AdvancedApocryphalSpellId { get; set; } +``` + +#### Property Value +[System\.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1')[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md b/Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md new file mode 100644 index 0000000..6254b3a --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedDomainSpell Property + +Продвинутое заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell AdvancedDomainSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md b/Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md new file mode 100644 index 0000000..dea80a1 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedDomainSpellId Property + +Идентификатор продвинутого заклинания домена\. + +```csharp +public int AdvancedDomainSpellId { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.ApocryphalSpell.md b/Documentation/Pf2eModel/Domain.ApocryphalSpell.md new file mode 100644 index 0000000..c1e5985 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.ApocryphalSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.ApocryphalSpell Property + +Апокрифическое заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell? ApocryphalSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.ApocryphalSpellId.md b/Documentation/Pf2eModel/Domain.ApocryphalSpellId.md new file mode 100644 index 0000000..8799f79 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.ApocryphalSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.ApocryphalSpellId Property + +Идентификатор апокрифического заклинания домена\. + +```csharp +public System.Nullable ApocryphalSpellId { get; set; } +``` + +#### Property Value +[System\.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1')[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.DeityDomains.md b/Documentation/Pf2eModel/Domain.DeityDomains.md new file mode 100644 index 0000000..d1fb34b --- /dev/null +++ b/Documentation/Pf2eModel/Domain.DeityDomains.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.DeityDomains Property + +Связи с божествами, которые используют этот домен\. + +```csharp +public virtual System.Collections.Generic.ICollection DeityDomains { get; set; } +``` + +#### Property Value +[System\.Collections\.Generic\.ICollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.ICollection-1 'System\.Collections\.Generic\.ICollection\`1')[DeityDomain](DeityDomain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.ICollection-1 'System\.Collections\.Generic\.ICollection\`1') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.DomainSpell.md b/Documentation/Pf2eModel/Domain.DomainSpell.md new file mode 100644 index 0000000..a1bce17 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.DomainSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.DomainSpell Property + +Заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell DomainSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.DomainSpellId.md b/Documentation/Pf2eModel/Domain.DomainSpellId.md new file mode 100644 index 0000000..3170956 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.DomainSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.DomainSpellId Property + +Идентификатор заклинания домена\. + +```csharp +public int DomainSpellId { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.Entity.md b/Documentation/Pf2eModel/Domain.Entity.md new file mode 100644 index 0000000..0dba2ed --- /dev/null +++ b/Documentation/Pf2eModel/Domain.Entity.md @@ -0,0 +1,15 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.Entity Property + +Корневая сущность\. + +```csharp +public Pf2eModel.Model.Base.Entity Entity { get; set; } +``` + +Implements [Entity](IEntity.Entity.md 'Pf2eModel\.Model\.IEntity\.Entity') + +#### Property Value +[Entity](Entity.md 'Pf2eModel\.Model\.Base\.Entity') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.Id.md b/Documentation/Pf2eModel/Domain.Id.md new file mode 100644 index 0000000..52e6d53 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.Id.md @@ -0,0 +1,15 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.Id Property + +Идентификатор сущности\. + +```csharp +public int Id { get; set; } +``` + +Implements [Id](IEntity.Id.md 'Pf2eModel\.Model\.IEntity\.Id') + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.md b/Documentation/Pf2eModel/Domain.md new file mode 100644 index 0000000..d71231d --- /dev/null +++ b/Documentation/Pf2eModel/Domain.md @@ -0,0 +1,28 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure') + +## Domain Class + +Домен\. + +```csharp +public class Domain : Pf2eModel.Model.IEntity +``` + +Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 Domain + +Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity') + +| Properties | | +| :--- | :--- | +| [AdvancedApocryphalSpell](Domain.AdvancedApocryphalSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedApocryphalSpell') | Продвинутое апокрифическое заклинание домена\. | +| [AdvancedApocryphalSpellId](Domain.AdvancedApocryphalSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedApocryphalSpellId') | Идентификатор продвинутого апокрифического заклинания домена\. | +| [AdvancedDomainSpell](Domain.AdvancedDomainSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedDomainSpell') | Продвинутое заклинание домена\. | +| [AdvancedDomainSpellId](Domain.AdvancedDomainSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedDomainSpellId') | Идентификатор продвинутого заклинания домена\. | +| [ApocryphalSpell](Domain.ApocryphalSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.ApocryphalSpell') | Апокрифическое заклинание домена\. | +| [ApocryphalSpellId](Domain.ApocryphalSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.ApocryphalSpellId') | Идентификатор апокрифического заклинания домена\. | +| [DeityDomains](Domain.DeityDomains.md 'Pf2eModel\.Model\.Structure\.Domain\.DeityDomains') | Связи с божествами, которые используют этот домен\. | +| [DomainSpell](Domain.DomainSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.DomainSpell') | Заклинание домена\. | +| [DomainSpellId](Domain.DomainSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.DomainSpellId') | Идентификатор заклинания домена\. | +| [Entity](Domain.Entity.md 'Pf2eModel\.Model\.Structure\.Domain\.Entity') | Корневая сущность\. | +| [Id](Domain.Id.md 'Pf2eModel\.Model\.Structure\.Domain\.Id') | Идентификатор сущности\. | diff --git a/Documentation/Pf2eModel/EntityType.md b/Documentation/Pf2eModel/EntityType.md index e2fc266..76d4704 100644 --- a/Documentation/Pf2eModel/EntityType.md +++ b/Documentation/Pf2eModel/EntityType.md @@ -82,44 +82,50 @@ public enum EntityType Состояние\. + + +`Domain` 12 + +Домен божества\. + -`Deity` 12 +`Deity` 13 Божество\. -`Feat` 13 +`Feat` 14 Навык\. -`Heritage` 14 +`Heritage` 15 Наследие\. -`Spell` 15 +`Spell` 16 Заклианиние\. -`Ritual` 16 +`Ritual` 17 Ритуал\. -`Language` 17 +`Language` 18 Язык\. -`Rule` 18 +`Rule` 19 Правило\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/IEntity.md b/Documentation/Pf2eModel/IEntity.md index 4cdc981..5383d58 100644 --- a/Documentation/Pf2eModel/IEntity.md +++ b/Documentation/Pf2eModel/IEntity.md @@ -17,6 +17,7 @@ Derived ↳ [Class](Class.md 'Pf2eModel\.Model\.Structure\.Class') ↳ [Condition](Condition.md 'Pf2eModel\.Model\.Structure\.Condition') ↳ [Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') +↳ [Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') ↳ [Feat](Feat.md 'Pf2eModel\.Model\.Structure\.Feat') ↳ [Heritage](Heritage.md 'Pf2eModel\.Model\.Structure\.Heritage') ↳ [Language](Language.md 'Pf2eModel\.Model\.Structure\.Language') diff --git a/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md b/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md index cb0d2ca..c8e971b 100644 --- a/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md +++ b/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md @@ -14,6 +14,7 @@ | [Class](Class.md 'Pf2eModel\.Model\.Structure\.Class') | Класс\. | | [Condition](Condition.md 'Pf2eModel\.Model\.Structure\.Condition') | Состояние\. | | [Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') | Божество\. | +| [Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') | Домен\. | | [Feat](Feat.md 'Pf2eModel\.Model\.Structure\.Feat') | Способность\. | | [Heritage](Heritage.md 'Pf2eModel\.Model\.Structure\.Heritage') | Наследие\. | | [Language](Language.md 'Pf2eModel\.Model\.Structure\.Language') | Язык\. | diff --git a/Documentation/Pf2eModel/TraitType.md b/Documentation/Pf2eModel/TraitType.md index 5b27d88..3355aaa 100644 --- a/Documentation/Pf2eModel/TraitType.md +++ b/Documentation/Pf2eModel/TraitType.md @@ -16,14 +16,20 @@ public enum TraitType Обычный признак\. + + +`Alignment` 1 + +Мировоззрение\. + -`Class` 1 +`Class` 2 Признак класса\. -`Tradition` 2 +`Tradition` 3 Признак традиции\. \ No newline at end of file diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs index 71787da..ed69a49 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs @@ -26,6 +26,11 @@ internal class AonprdBuilderGlobals /// public Dictionary TraitIds { get; } = []; + /// + /// Список идентификаторов сущностей, которые нужно игнорировать при обработке. + /// + public List Ignore { get; } = []; + /// /// Словарей суффиксов для сущностей /// @@ -63,6 +68,8 @@ internal class AonprdBuilderGlobals if (json is not null) { + Ignore = json.SelectToken("Ignore")?.ToObject>() ?? []; + SlugSuffixes = JsonToDictionary(json, "SlugSuffixes"); LegacyRemasterExtra = JsonToDictionary(json, "LegacyRemasterExtra"); MergeSources = JsonToDictionary(json, "MergeSources"); diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs index 4d19957..25cfcc7 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs @@ -100,7 +100,14 @@ internal abstract class AbstractEntityProcessor( /// public virtual void Check() { - if (Globals.MergeSources.ContainsKey(Input.GetRequired("id"))) + string id = Input.GetRequired("id"); + + if (Globals.Ignore.Contains(id)) + { + throw new SkipItemException(Name, "игнорируется."); + } + + if (Globals.MergeSources.ContainsKey(id)) { throw new SkipItemException(Name, "помечено на слияние."); } @@ -217,7 +224,7 @@ internal abstract class AbstractEntityProcessor( EntitySource entitySource = new() { Entity = Entity, - SourceId = Globals.SourceIds[sourceName], + SourceId = Globals.SourceIds[sourceName.Trim()], Suffix = StringHelper.ResolveSourceSuffix( Input.GetRequired("source_markdown") ), diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs new file mode 100644 index 0000000..bcaf0b4 --- /dev/null +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs @@ -0,0 +1,247 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Newtonsoft.Json.Linq; +using Pf2eDataScrapper.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; +using Pf2eDataScrapper.Processors; +using Pf2eDataScrapper.Processors.Attributes; +using Pf2eModel; +using Pf2eModel.Model.Common; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure; +using Pf2eModel.Model.Structure.DeityRelation; +using StringHelper = Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers.StringHelper; + +namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; + +[ProcessorCollection( + "aonprd:deity", + InnerType = "deity", + CompendiumType = ProcessorCompendiumEnum.Aonprd, + Description = "Божества", + Group = ProcessorGroupEnum.AonprdEntities +)] +[ProcessorDependencies(["aonprd:domain", "aonprd:spell", "aonprd:trait", "aonprd:source"])] +internal partial class DeityProcessor( + ProcessorInput input, + StringHelper stringHelper, + DatabaseHelper helper, + AonprdBuilderGlobals globals +) : AbstractEntityProcessor(input, stringHelper, helper, globals) +{ + /// + public override EntityType Type => EntityType.Deity; + + /// + public override Deity Object { get; } = new(); + + /// + protected override void Add() => Context.Deities.Add(Object); + + /// + public override void Process() + { + base.Process(); + + // Установка категории божества + Object.Category = Input.EnumRequired("deity_category"); + + // Обработка божественной силы + ProcessFonts(); + + // Обработка освящения + ProcessSanctification(); + + // Обработка атрибутов + ProcessAttributes(); + + // Обработка доменов + ProcessDomains(); + + // Обработка заклинаний + ProcessSpells(); + + // Обработка оружия + ProcessWeapons(); + + // Обработка навыков + ProcessSkills(); + } + + /// + /// Обработка божественной силы. + /// + private void ProcessFonts() + { + JArray fonts = Input.GetOptional("divine_font") ?? []; + + switch (fonts.Count) + { + case 0: + Object.Fonts = DeityFonts.None; + return; + + // Если есть и Heal, и Harm + case 2: + Object.Fonts = DeityFonts.Any; + return; + + default: + { + // Определяем тип по первому элементу + string font = fonts[0].ToString(); + Object.Fonts = Input.Enum(font); + break; + } + } + } + + /// + /// Обработка освящения. + /// + private void ProcessSanctification() + { + // По умолчанию любое освящение + Object.Sanctification = DeitySanctification.Any; + Object.SanctificationMust = false; + } + + /// + /// Обработка атрибутов божества. + /// + private void ProcessAttributes() + { + JArray attributes = Input.GetOptional("attribute") ?? []; + foreach (JToken token in attributes) + { + AttributeValues attribute = Input.Enum(token.ToString()); + Object.DeityAttributes.Add(new() { Deity = Object, Attribute = attribute }); + } + } + + /// + /// Обработка доменов божества. + /// + private void ProcessDomains() + { + // Обработка основных доменов + string primaryDomainsMarkdown = Input.GetRequired("domain_primary_markdown"); + ProcessDomainMarkdown(primaryDomainsMarkdown, true); + + // Обработка альтернативных доменов + string alternateDomainsMarkdown = Input.GetRequired("domain_alternate_markdown"); + ProcessDomainMarkdown(alternateDomainsMarkdown, false); + } + + /// + /// Обработка markdown-строки с доменами. + /// + /// Markdown-строка с доменами. + /// Флаг, указывающий, являются ли домены основными. + private void ProcessDomainMarkdown(string markdown, bool isPrimary) + { + // Разделяем markdown на отдельные ссылки + MatchCollection matches = MarkdownLinkRegex().Matches(markdown); + foreach (Match match in matches) + { + string domainName = match.Groups[1].Value; + + // Ищем домен в базе данных + Domain? domain = Context.Domains.FirstOrDefault(d => + Pf2eDbContext.LocaleSearch(d.Entity.Name, domainName) + ); + + if (domain != null) + { + Object.DeityDomains.Add( + new() + { + Deity = Object, + Domain = domain, + IsPrimary = isPrimary, + Value = domainName, + } + ); + } + } + } + + /// + /// Обработка заклинаний божества. + /// + private void ProcessSpells() + { + string spellsMarkdown = Input.GetRequired("spell_markdown"); + MatchCollection matches = MarkdownLinkRegex().Matches(spellsMarkdown); + + int level = 1; + foreach (Match match in matches) + { + string spellName = match.Groups[1].Value; + + // Ищем заклинание в базе данных + Spell? spell = Context.Spells.FirstOrDefault(s => + Pf2eDbContext.LocaleSearch(s.Entity.Name, spellName) + ); + + if (spell != null) + { + Object.DeitySpells.Add( + new() + { + Deity = Object, + Spell = spell, + Level = level, + } + ); + } + level++; + } + } + + /// + /// Обработка оружия божества. + /// + private void ProcessWeapons() + { + string weaponsMarkdown = Input.GetRequired("favored_weapon_markdown"); + MatchCollection matches = MarkdownLinkRegex().Matches(weaponsMarkdown); + + foreach (Match match in matches) + { + string weaponName = match.Groups[1].Value; + Object.DeityWeapons.Add(new() { Deity = Object, Weapon = weaponName }); + } + } + + /// + /// Обработка навыков божества. + /// + private void ProcessSkills() + { + string skillsMarkdown = Input.GetRequired("skill_markdown"); + MatchCollection matches = MarkdownLinkRegex().Matches(skillsMarkdown); + + foreach (Match match in matches) + { + string skillName = match.Groups[1].Value; + + // Ищем навык в базе данных + Training? training = Context.Trainings.FirstOrDefault(t => + Pf2eDbContext.LocaleSearch(t.Name, skillName) + ); + + if (training != null) + { + Object.Skills.Add(training); + } + } + } + + /// + /// Регулярное выражение для извлечения названия из markdown-ссылки. + /// + /// Скомпилированное регулярное выражение. + [GeneratedRegex(@"\[([^\]]+)\]\([^)]+\)")] + private static partial Regex MarkdownLinkRegex(); +} diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs new file mode 100644 index 0000000..dc7edf9 --- /dev/null +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs @@ -0,0 +1,119 @@ +using System; +using System.Linq; +using System.Text.RegularExpressions; +using Pf2eDataScrapper.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; +using Pf2eDataScrapper.Processors; +using Pf2eDataScrapper.Processors.Attributes; +using Pf2eModel; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure; +using StringHelper = Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers.StringHelper; + +namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; + +[ProcessorCollection( + "aonprd:domain", + InnerType = "domain", + CompendiumType = ProcessorCompendiumEnum.Aonprd, + Description = "Домены", + Group = ProcessorGroupEnum.AonprdEntities +)] +[ProcessorDependencies(["aonprd:spell"])] +internal partial class DomainProcessor( + ProcessorInput input, + StringHelper stringHelper, + DatabaseHelper helper, + AonprdBuilderGlobals globals +) : AbstractEntityProcessor(input, stringHelper, helper, globals) +{ + /// + public override EntityType Type => EntityType.Domain; + + /// + public override Domain Object { get; } = new(); + + /// + protected override void Add() => Context.Domains.Add(Object); + + /// + public override void Process() + { + base.Process(); + + // Обработка заклинаний домена + ProcessDomainSpells(); + } + + /// + /// Обработка заклинаний, связанных с доменом. + /// + private void ProcessDomainSpells() + { + // Обработка основного заклинания домена + string domainSpellMarkdown = Input.GetRequired("domain_spell_markdown"); + Object.DomainSpellId = GetSpellIdFromMarkdown(domainSpellMarkdown); + + // Обработка продвинутого заклинания домена + string advancedDomainSpellMarkdown = Input.GetRequired( + "advanced_domain_spell_markdown" + ); + Object.AdvancedDomainSpellId = GetSpellIdFromMarkdown(advancedDomainSpellMarkdown); + + // Обработка апокрифического заклинания (если есть) + string? apocryphalSpellMarkdown = Input.GetOptional("apocryphal_spell_markdown"); + if (!string.IsNullOrEmpty(apocryphalSpellMarkdown)) + { + Object.ApocryphalSpellId = GetSpellIdFromMarkdown(apocryphalSpellMarkdown); + } + + // Обработка продвинутого апокрифического заклинания (если есть) + string? advancedApocryphalSpellMarkdown = Input.GetOptional( + "advanced_apocryphal_spell_markdown" + ); + if (!string.IsNullOrEmpty(advancedApocryphalSpellMarkdown)) + { + Object.AdvancedApocryphalSpellId = GetSpellIdFromMarkdown( + advancedApocryphalSpellMarkdown + ); + } + } + + /// + /// Получение идентификатора заклинания из markdown-строки. + /// + /// Markdown-строка с информацией о заклинании. + /// Идентификатор заклинания. + private int GetSpellIdFromMarkdown(string markdown) + { + // Используем регулярное выражение для извлечения названия заклинания + // Формат: [Название заклинания](/Spells.aspx?ID=XXX) + Match match = MarkdownLinkRegex().Match(markdown); + + if (!match.Success) + { + throw new InvalidOperationException($"Invalid markdown format: {markdown}"); + } + + string spellName = match.Groups[1].Value; + + // Поиск заклинания в базе данных + Spell? spell = Context.Spells.FirstOrDefault(s => + Pf2eDbContext.LocaleSearch(s.Entity.Name, spellName) + ); + + if (spell == null) + { + throw new InvalidOperationException($"Spell '{spellName}' not found in database"); + } + + return spell.Id; + } + + /// + /// Регулярное выражение для извлечения названия из markdown-ссылки. + /// + /// Скомпилированное регулярное выражение. + [GeneratedRegex(@"\[([^\]]+)\]\([^)]+\)")] + private static partial Regex MarkdownLinkRegex(); +} diff --git a/Pf2eDataScrapper/Resources/ImportAdaptation.json b/Pf2eDataScrapper/Resources/ImportAdaptation.json index 0a012bc..71fe152 100644 --- a/Pf2eDataScrapper/Resources/ImportAdaptation.json +++ b/Pf2eDataScrapper/Resources/ImportAdaptation.json @@ -1,5 +1,8 @@ { "Aonprd": { + "Ignore": [ + "domain-38" + ], "SlugSuffixes": { "spell-843": "initial", "feat-455": "initial", diff --git a/Pf2eModel/Migrations/20250913071004_1.Designer.cs b/Pf2eModel/Migrations/20250913084534_1.Designer.cs similarity index 95% rename from Pf2eModel/Migrations/20250913071004_1.Designer.cs rename to Pf2eModel/Migrations/20250913084534_1.Designer.cs index c30439f..ba9d372 100644 --- a/Pf2eModel/Migrations/20250913071004_1.Designer.cs +++ b/Pf2eModel/Migrations/20250913084534_1.Designer.cs @@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum; namespace Pf2eModel.Migrations { [DbContext(typeof(Pf2eDbContext))] - [Migration("20250913071004_1")] + [Migration("20250913084534_1")] partial class _1 { /// @@ -34,7 +34,7 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); @@ -1195,6 +1195,12 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Идентификатор божества"); + b.Property("DomainId") + .HasColumnType("integer") + .HasColumnName("domain_id") + .HasColumnOrder(4) + .HasComment("Идентификатор домена"); + b.Property("IsPrimary") .HasColumnType("boolean") .HasColumnName("is_primary") @@ -1206,7 +1212,7 @@ namespace Pf2eModel.Migrations .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("value") - .HasColumnOrder(4); + .HasColumnOrder(5); b.HasKey("Id") .HasName("pk_deity_domains"); @@ -1214,6 +1220,9 @@ namespace Pf2eModel.Migrations b.HasIndex("DeityId") .HasDatabaseName("ix_deity_domains_deity_id"); + b.HasIndex("DomainId") + .HasDatabaseName("ix_deity_domains_domain_id"); + b.ToTable("deity_domains", (string)null); }); @@ -1292,6 +1301,56 @@ namespace Pf2eModel.Migrations b.ToTable("deity_weapons", (string)null); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AdvancedApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_apocryphal_spell_id") + .HasColumnOrder(5) + .HasComment("Продвинутое апокрифическое заклинание домена"); + + b.Property("AdvancedDomainSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_domain_spell_id") + .HasColumnOrder(3) + .HasComment("Продвинутое заклинание домена"); + + b.Property("ApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("apocryphal_spell_id") + .HasColumnOrder(4) + .HasComment("Апокрифическое заклинание домена"); + + b.Property("DomainSpellId") + .HasColumnType("integer") + .HasColumnName("domain_spell_id") + .HasColumnOrder(2) + .HasComment("Заклинание домена"); + + b.HasKey("Id") + .HasName("pk_domains"); + + b.HasIndex("AdvancedApocryphalSpellId") + .HasDatabaseName("ix_domains_advanced_apocryphal_spell_id"); + + b.HasIndex("AdvancedDomainSpellId") + .HasDatabaseName("ix_domains_advanced_domain_spell_id"); + + b.HasIndex("ApocryphalSpellId") + .HasDatabaseName("ix_domains_apocryphal_spell_id"); + + b.HasIndex("DomainSpellId") + .HasDatabaseName("ix_domains_domain_spell_id"); + + b.ToTable("domains", (string)null); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Property("Id") @@ -2406,7 +2465,16 @@ namespace Pf2eModel.Migrations .IsRequired() .HasConstraintName("fk_deity_domains_deities_deity_id"); + b.HasOne("Pf2eModel.Model.Structure.Domain", "Domain") + .WithMany("DeityDomains") + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_domains_domains_domain_id"); + b.Navigation("Deity"); + + b.Navigation("Domain"); }); modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeitySpell", b => @@ -2442,6 +2510,52 @@ namespace Pf2eModel.Migrations b.Navigation("Deity"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedApocryphalSpell") + .WithMany() + .HasForeignKey("AdvancedApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_advanced_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedDomainSpell") + .WithMany() + .HasForeignKey("AdvancedDomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_advanced_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "ApocryphalSpell") + .WithMany() + .HasForeignKey("ApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "DomainSpell") + .WithMany() + .HasForeignKey("DomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Domain", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_entities_id"); + + b.Navigation("AdvancedApocryphalSpell"); + + b.Navigation("AdvancedDomainSpell"); + + b.Navigation("ApocryphalSpell"); + + b.Navigation("DomainSpell"); + + b.Navigation("Entity"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") @@ -2732,6 +2846,11 @@ namespace Pf2eModel.Migrations b.Navigation("DeityWeapons"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Navigation("DeityDomains"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Navigation("FeatPrerequisites"); diff --git a/Pf2eModel/Migrations/20250913071004_1.cs b/Pf2eModel/Migrations/20250913084534_1.cs similarity index 95% rename from Pf2eModel/Migrations/20250913071004_1.cs rename to Pf2eModel/Migrations/20250913084534_1.cs index 85c952c..cbb6fd7 100644 --- a/Pf2eModel/Migrations/20250913071004_1.cs +++ b/Pf2eModel/Migrations/20250913084534_1.cs @@ -24,7 +24,7 @@ namespace Pf2eModel.Migrations .Annotation("Npgsql:Enum:deity_sanctification", "any,holy,unholy") .Annotation("Npgsql:Enum:element_enum", "air,earth,fire,metal,universal,water,wood") .Annotation("Npgsql:Enum:entity_rarity", "common,rare,uncommon,unique") - .Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown") + .Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,domain,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown") .Annotation("Npgsql:Enum:feat_category", "ancestry,ancestry-feature,archetype,bonus,calling,campaign-feature,class,class-feature,curse,deityboon,general,pfsboon,skill,uncategorized") .Annotation("Npgsql:Enum:locale_type", "english,hobby,other,russian") .Annotation("Npgsql:Enum:size_enum", "huge,large,medium,small,tiny") @@ -792,27 +792,6 @@ namespace Pf2eModel.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "deity_domains", - columns: table => new - { - id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), - is_primary = table.Column(type: "boolean", nullable: false, comment: "Флаг основного домена"), - value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_deity_domains", x => x.id); - table.ForeignKey( - name: "fk_deity_domains_deities_deity_id", - column: x => x.deity_id, - principalTable: "deities", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "deity_training", columns: table => new @@ -1003,6 +982,51 @@ namespace Pf2eModel.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "domains", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + domain_spell_id = table.Column(type: "integer", nullable: false, comment: "Заклинание домена"), + advanced_domain_spell_id = table.Column(type: "integer", nullable: false, comment: "Продвинутое заклинание домена"), + apocryphal_spell_id = table.Column(type: "integer", nullable: true, comment: "Апокрифическое заклинание домена"), + advanced_apocryphal_spell_id = table.Column(type: "integer", nullable: true, comment: "Продвинутое апокрифическое заклинание домена") + }, + constraints: table => + { + table.PrimaryKey("pk_domains", x => x.id); + table.ForeignKey( + name: "fk_domains_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_domains_spells_advanced_apocryphal_spell_id", + column: x => x.advanced_apocryphal_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "fk_domains_spells_advanced_domain_spell_id", + column: x => x.advanced_domain_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_domains_spells_apocryphal_spell_id", + column: x => x.apocryphal_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "fk_domains_spells_domain_spell_id", + column: x => x.domain_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "spell_areas", columns: table => new @@ -1146,6 +1170,34 @@ namespace Pf2eModel.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "deity_domains", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), + is_primary = table.Column(type: "boolean", nullable: false, comment: "Флаг основного домена"), + domain_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор домена"), + value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_deity_domains", x => x.id); + table.ForeignKey( + name: "fk_deity_domains_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_deity_domains_domains_domain_id", + column: x => x.domain_id, + principalTable: "domains", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "subclass_provided_entities", columns: table => new @@ -1273,6 +1325,11 @@ namespace Pf2eModel.Migrations table: "deity_domains", column: "deity_id"); + migrationBuilder.CreateIndex( + name: "ix_deity_domains_domain_id", + table: "deity_domains", + column: "domain_id"); + migrationBuilder.CreateIndex( name: "ix_deity_spells_deity_id", table: "deity_spells", @@ -1293,6 +1350,26 @@ namespace Pf2eModel.Migrations table: "deity_weapons", column: "deity_id"); + migrationBuilder.CreateIndex( + name: "ix_domains_advanced_apocryphal_spell_id", + table: "domains", + column: "advanced_apocryphal_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_advanced_domain_spell_id", + table: "domains", + column: "advanced_domain_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_apocryphal_spell_id", + table: "domains", + column: "apocryphal_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_domain_spell_id", + table: "domains", + column: "domain_spell_id"); + migrationBuilder.CreateIndex( name: "ix_entity_aliases_entity_id", table: "entity_aliases", @@ -1521,6 +1598,9 @@ namespace Pf2eModel.Migrations migrationBuilder.DropTable( name: "backgrounds"); + migrationBuilder.DropTable( + name: "domains"); + migrationBuilder.DropTable( name: "deities"); @@ -1542,9 +1622,6 @@ namespace Pf2eModel.Migrations migrationBuilder.DropTable( name: "rituals"); - migrationBuilder.DropTable( - name: "spells"); - migrationBuilder.DropTable( name: "subclasses"); @@ -1554,6 +1631,9 @@ namespace Pf2eModel.Migrations migrationBuilder.DropTable( name: "feats"); + migrationBuilder.DropTable( + name: "spells"); + migrationBuilder.DropTable( name: "subclass_groups"); diff --git a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs index 288db0a..55354e5 100644 --- a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs +++ b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs @@ -31,7 +31,7 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); @@ -1192,6 +1192,12 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Идентификатор божества"); + b.Property("DomainId") + .HasColumnType("integer") + .HasColumnName("domain_id") + .HasColumnOrder(4) + .HasComment("Идентификатор домена"); + b.Property("IsPrimary") .HasColumnType("boolean") .HasColumnName("is_primary") @@ -1203,7 +1209,7 @@ namespace Pf2eModel.Migrations .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("value") - .HasColumnOrder(4); + .HasColumnOrder(5); b.HasKey("Id") .HasName("pk_deity_domains"); @@ -1211,6 +1217,9 @@ namespace Pf2eModel.Migrations b.HasIndex("DeityId") .HasDatabaseName("ix_deity_domains_deity_id"); + b.HasIndex("DomainId") + .HasDatabaseName("ix_deity_domains_domain_id"); + b.ToTable("deity_domains", (string)null); }); @@ -1289,6 +1298,56 @@ namespace Pf2eModel.Migrations b.ToTable("deity_weapons", (string)null); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AdvancedApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_apocryphal_spell_id") + .HasColumnOrder(5) + .HasComment("Продвинутое апокрифическое заклинание домена"); + + b.Property("AdvancedDomainSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_domain_spell_id") + .HasColumnOrder(3) + .HasComment("Продвинутое заклинание домена"); + + b.Property("ApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("apocryphal_spell_id") + .HasColumnOrder(4) + .HasComment("Апокрифическое заклинание домена"); + + b.Property("DomainSpellId") + .HasColumnType("integer") + .HasColumnName("domain_spell_id") + .HasColumnOrder(2) + .HasComment("Заклинание домена"); + + b.HasKey("Id") + .HasName("pk_domains"); + + b.HasIndex("AdvancedApocryphalSpellId") + .HasDatabaseName("ix_domains_advanced_apocryphal_spell_id"); + + b.HasIndex("AdvancedDomainSpellId") + .HasDatabaseName("ix_domains_advanced_domain_spell_id"); + + b.HasIndex("ApocryphalSpellId") + .HasDatabaseName("ix_domains_apocryphal_spell_id"); + + b.HasIndex("DomainSpellId") + .HasDatabaseName("ix_domains_domain_spell_id"); + + b.ToTable("domains", (string)null); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Property("Id") @@ -2403,7 +2462,16 @@ namespace Pf2eModel.Migrations .IsRequired() .HasConstraintName("fk_deity_domains_deities_deity_id"); + b.HasOne("Pf2eModel.Model.Structure.Domain", "Domain") + .WithMany("DeityDomains") + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_domains_domains_domain_id"); + b.Navigation("Deity"); + + b.Navigation("Domain"); }); modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeitySpell", b => @@ -2439,6 +2507,52 @@ namespace Pf2eModel.Migrations b.Navigation("Deity"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedApocryphalSpell") + .WithMany() + .HasForeignKey("AdvancedApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_advanced_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedDomainSpell") + .WithMany() + .HasForeignKey("AdvancedDomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_advanced_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "ApocryphalSpell") + .WithMany() + .HasForeignKey("ApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "DomainSpell") + .WithMany() + .HasForeignKey("DomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Domain", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_entities_id"); + + b.Navigation("AdvancedApocryphalSpell"); + + b.Navigation("AdvancedDomainSpell"); + + b.Navigation("ApocryphalSpell"); + + b.Navigation("DomainSpell"); + + b.Navigation("Entity"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") @@ -2729,6 +2843,11 @@ namespace Pf2eModel.Migrations b.Navigation("DeityWeapons"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Navigation("DeityDomains"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Navigation("FeatPrerequisites"); diff --git a/Pf2eModel/Model/Enum/TraitType.cs b/Pf2eModel/Model/Enum/TraitType.cs index 379ec1f..00f87d5 100644 --- a/Pf2eModel/Model/Enum/TraitType.cs +++ b/Pf2eModel/Model/Enum/TraitType.cs @@ -13,6 +13,12 @@ public enum TraitType [PgName("regular")] Regular, + /// + /// Мировоззрение. + /// + [PgName("alignment")] + Alignment, + /// /// Признак класса. /// diff --git a/Pf2eModel/Model/Structure/Domain.cs b/Pf2eModel/Model/Structure/Domain.cs index b783f57..6a98924 100644 --- a/Pf2eModel/Model/Structure/Domain.cs +++ b/Pf2eModel/Model/Structure/Domain.cs @@ -23,40 +23,32 @@ public class Domain : IEntity /// public Entity Entity { get; set; } = null!; - /// - /// Название домена. - /// - [Column(Order = 2)] - [MaxLength(Pf2eDbContext.NameLength)] - [Comment("Название домена")] - public string Name { get; set; } = null!; - /// /// Идентификатор заклинания домена. /// - [Column(Order = 3)] - [Comment("Идентификатор заклинания домена")] + [Column(Order = 2)] + [Comment("Заклинание домена")] public int DomainSpellId { get; set; } /// /// Идентификатор продвинутого заклинания домена. /// - [Column(Order = 4)] - [Comment("Идентификатор продвинутого заклинания домена")] + [Column(Order = 3)] + [Comment("Продвинутое заклинание домена")] public int AdvancedDomainSpellId { get; set; } /// /// Идентификатор апокрифического заклинания домена. /// - [Column(Order = 5)] - [Comment("Идентификатор апокрифического заклинания домена")] + [Column(Order = 4)] + [Comment("Апокрифическое заклинание домена")] public int? ApocryphalSpellId { get; set; } /// /// Идентификатор продвинутого апокрифического заклинания домена. /// - [Column(Order = 6)] - [Comment("Идентификатор продвинутого апокрифического заклинания домена")] + [Column(Order = 5)] + [Comment("Продвинутое апокрифическое заклинание домена")] public int? AdvancedApocryphalSpellId { get; set; } /// From 66f3adc5f9422d66587431f0e559f70c7367df1e Mon Sep 17 00:00:00 2001 From: Ilya Kozhemyakin Date: Sat, 13 Sep 2025 18:35:25 +0400 Subject: [PATCH 4/5] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B3=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D1=81=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8=20=D0=B1=D0=BE=D0=B6=D0=B5=D1=81=D1=82=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Aonprd/Processors/Types/DeityProcessor.cs | 52 +++++++++++++++++++ Pf2eModel/Model/Structure/Deity.cs | 31 ++++++++++- Pf2eModel/Pf2eDbContextModel.cs | 10 ++-- 3 files changed, 88 insertions(+), 5 deletions(-) diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs index bcaf0b4..db7124d 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs @@ -101,9 +101,61 @@ internal partial class DeityProcessor( /// private void ProcessSanctification() { + // Получаем выравнивание божества + string? deityAlignment = Input.GetOptional("alignment"); + // По умолчанию любое освящение Object.Sanctification = DeitySanctification.Any; Object.SanctificationMust = false; + + // Определяем освящение на основе выравнивания божества + if (!string.IsNullOrEmpty(deityAlignment)) + { + switch (deityAlignment) + { + case "LG": + case "NG": + case "CG": + Object.Sanctification = DeitySanctification.Holy; + break; + case "LE": + case "NE": + case "CE": + Object.Sanctification = DeitySanctification.Unholy; + break; + case "N": + case "LN": + case "CN": + case "Any": + Object.Sanctification = DeitySanctification.Any; + break; + } + } + + // Проверяем, требует ли божество определенного выравнивания от последователей + JArray? followerAlignments = Input.GetOptional("follower_alignment"); + if (followerAlignments != null && followerAlignments.Count > 0) + { + // Если выравнивание последователей ограничено, то освящение обязательно + Object.SanctificationMust = true; + + // Если освящение Any, но выравнивания последователей ограничены только добрыми или злыми, + // уточняем тип освящения + if (Object.Sanctification == DeitySanctification.Any) + { + bool allGood = followerAlignments.All(a => a.ToString() is "LG" or "NG" or "CG"); + bool allEvil = followerAlignments.All(a => a.ToString() is "LE" or "NE" or "CE"); + + if (allGood) + { + Object.Sanctification = DeitySanctification.Holy; + } + else if (allEvil) + { + Object.Sanctification = DeitySanctification.Unholy; + } + } + } } /// diff --git a/Pf2eModel/Model/Structure/Deity.cs b/Pf2eModel/Model/Structure/Deity.cs index 0f34c08..58dc4ba 100644 --- a/Pf2eModel/Model/Structure/Deity.cs +++ b/Pf2eModel/Model/Structure/Deity.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Common; +using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.DeityRelation; @@ -53,7 +54,35 @@ public class Deity : IEntity public bool SanctificationMust { get; set; } /// - /// Аттрибуты божества. + /// Заветы божества. + /// + [Column(Order = 6)] + [Comment("Заветы божества")] + public LocaleString Edicts { get; set; } = null!; + + /// + /// Анафемы божества. + /// + [Column(Order = 7)] + [Comment("Анафемы божества")] + public LocaleString Anathema { get; set; } = null!; + + /// + /// Религиозный символ божества. + /// + [Column(Order = 8)] + [Comment("Религиозный символ божества")] + public LocaleString ReligiousSymbol { get; set; } = null!; + + /// + /// Священное животное божества. + /// + [Column(Order = 9)] + [Comment("Священное животное божества")] + public LocaleString SacredAnimal { get; set; } = null!; + + /// + /// Атрибуты божества. /// public ICollection DeityAttributes { get; set; } = new List(); diff --git a/Pf2eModel/Pf2eDbContextModel.cs b/Pf2eModel/Pf2eDbContextModel.cs index d94525a..d343fb6 100644 --- a/Pf2eModel/Pf2eDbContextModel.cs +++ b/Pf2eModel/Pf2eDbContextModel.cs @@ -434,6 +434,11 @@ public partial class Pf2eDbContext { BindEntity(entity); + BindLocaleString(entity, d => d.Anathema); + BindLocaleString(entity, d => d.Edicts); + BindLocaleString(entity, d => d.ReligiousSymbol); + BindLocaleString(entity, d => d.SacredAnimal); + entity .HasMany(e => e.DeityAttributes) .WithOne(e => e.Deity) @@ -461,10 +466,7 @@ public partial class Pf2eDbContext entity.HasMany(e => e.Skills).WithMany(); }); modelBuilder.Entity(entity => { }); - modelBuilder.Entity(entity => - { - // Связь теперь настроена в конфигурации Domain - }); + modelBuilder.Entity(entity => { }); modelBuilder.Entity(entity => { entity From 4aa107c3d9e49a3b2b64e3dd0d4a83a9e7efebfd Mon Sep 17 00:00:00 2001 From: Ilya Kozhemyakin Date: Sun, 14 Sep 2025 15:01:38 +0400 Subject: [PATCH 5/5] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D0=BE=D1=80=20=D0=B1=D0=BE=D0=B6=D0=B5=D1=81=D1=82=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeityProcessor.AddTraits().md | 10 ++ ...().md => DeityProcessor.ProcessTexts().md} | 6 +- .../Pf2eDataScrapper/DeityProcessor.md | 3 +- Documentation/Pf2eModel/Deity.Anathema.md | 13 +++ .../Pf2eModel/Deity.AreaOfConcern.md | 13 +++ Documentation/Pf2eModel/Deity.Category.md | 6 +- .../Pf2eModel/Deity.DeityAttributes.md | 2 +- Documentation/Pf2eModel/Deity.Edicts.md | 13 +++ .../Pf2eModel/Deity.ReligiousSymbol.md | 13 +++ Documentation/Pf2eModel/Deity.SacredAnimal.md | 13 +++ Documentation/Pf2eModel/Deity.Type.md | 13 +++ Documentation/Pf2eModel/Deity.md | 10 +- Documentation/Pf2eModel/DeityAttribute.Id.md | 13 +++ Documentation/Pf2eModel/DeityAttribute.md | 1 + Documentation/Pf2eModel/DeityCategory.md | 35 ------ Documentation/Pf2eModel/DeityType.md | 35 ++++++ .../Pf2eModel/Pf2eModel.Model.Enum.md | 2 +- .../Aonprd/Processors/Types/DeityProcessor.cs | 102 ++++++------------ .../Types/TraitAlignmentsProcessorFactory.cs | 88 +++++++++++++++ .../Aonprd/Processors/Types/TraitProcessor.cs | 4 +- ...signer.cs => 20250914093120_1.Designer.cs} | 84 ++++++++++++--- ...0250913084534_1.cs => 20250914093120_1.cs} | 23 +++- .../Migrations/Pf2eDbContextModelSnapshot.cs | 82 +++++++++++--- .../Enum/{DeityCategory.cs => DeityType.cs} | 2 +- Pf2eModel/Model/Structure/Deity.cs | 38 ++++--- .../Structure/DeityRelation/DeityAttribute.cs | 17 ++- Pf2eModel/Pf2eDbContext.cs | 2 +- Pf2eModel/Pf2eDbContextModel.cs | 1 + 28 files changed, 475 insertions(+), 169 deletions(-) create mode 100644 Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md rename Documentation/Pf2eDataScrapper/{DeityProcessor.ProcessSanctification().md => DeityProcessor.ProcessTexts().md} (73%) create mode 100644 Documentation/Pf2eModel/Deity.Anathema.md create mode 100644 Documentation/Pf2eModel/Deity.AreaOfConcern.md create mode 100644 Documentation/Pf2eModel/Deity.Edicts.md create mode 100644 Documentation/Pf2eModel/Deity.ReligiousSymbol.md create mode 100644 Documentation/Pf2eModel/Deity.SacredAnimal.md create mode 100644 Documentation/Pf2eModel/Deity.Type.md create mode 100644 Documentation/Pf2eModel/DeityAttribute.Id.md delete mode 100644 Documentation/Pf2eModel/DeityCategory.md create mode 100644 Documentation/Pf2eModel/DeityType.md create mode 100644 Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs rename Pf2eModel/Migrations/{20250913084534_1.Designer.cs => 20250914093120_1.Designer.cs} (97%) rename Pf2eModel/Migrations/{20250913084534_1.cs => 20250914093120_1.cs} (98%) rename Pf2eModel/Model/Enum/{DeityCategory.cs => DeityType.cs} (95%) diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md b/Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md new file mode 100644 index 0000000..ca181a3 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.AddTraits\(\) Method + +Генерация списка признаков сущности\. + +```csharp +protected override void AddTraits(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessTexts().md similarity index 73% rename from Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md rename to Documentation/Pf2eDataScrapper/DeityProcessor.ProcessTexts().md index 714a0b7..febd01f 100644 --- a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSanctification().md +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessTexts().md @@ -1,10 +1,10 @@ #### [Pf2eDataScrapper](index.md 'index') ### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') -## DeityProcessor\.ProcessSanctification\(\) Method +## DeityProcessor\.ProcessTexts\(\) Method -Обработка освящения\. +Обработка текстов описания божества\. ```csharp -private void ProcessSanctification(); +private void ProcessTexts(); ``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.md b/Documentation/Pf2eDataScrapper/DeityProcessor.md index ece2701..5f18a63 100644 --- a/Documentation/Pf2eDataScrapper/DeityProcessor.md +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.md @@ -17,13 +17,14 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | Methods | | | :--- | :--- | | [Add\(\)](DeityProcessor.Add().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Add\(\)') | Добавление основной сущности в контекст базы данных\. | +| [AddTraits\(\)](DeityProcessor.AddTraits().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.AddTraits\(\)') | Генерация списка признаков сущности\. | | [MarkdownLinkRegex\(\)](DeityProcessor.MarkdownLinkRegex().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.MarkdownLinkRegex\(\)') | | | [Process\(\)](DeityProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Process\(\)') | Основной метод обработки данных\. | | [ProcessAttributes\(\)](DeityProcessor.ProcessAttributes().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessAttributes\(\)') | Обработка атрибутов божества\. | | [ProcessDomainMarkdown\(string, bool\)](DeityProcessor.ProcessDomainMarkdown(string,bool).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomainMarkdown\(string, bool\)') | Обработка markdown\-строки с доменами\. | | [ProcessDomains\(\)](DeityProcessor.ProcessDomains().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomains\(\)') | Обработка доменов божества\. | | [ProcessFonts\(\)](DeityProcessor.ProcessFonts().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessFonts\(\)') | Обработка божественной силы\. | -| [ProcessSanctification\(\)](DeityProcessor.ProcessSanctification().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSanctification\(\)') | Обработка освящения\. | | [ProcessSkills\(\)](DeityProcessor.ProcessSkills().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSkills\(\)') | Обработка навыков божества\. | | [ProcessSpells\(\)](DeityProcessor.ProcessSpells().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSpells\(\)') | Обработка заклинаний божества\. | +| [ProcessTexts\(\)](DeityProcessor.ProcessTexts().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessTexts\(\)') | Обработка текстов описания божества\. | | [ProcessWeapons\(\)](DeityProcessor.ProcessWeapons().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessWeapons\(\)') | Обработка оружия божества\. | diff --git a/Documentation/Pf2eModel/Deity.Anathema.md b/Documentation/Pf2eModel/Deity.Anathema.md new file mode 100644 index 0000000..16dbde2 --- /dev/null +++ b/Documentation/Pf2eModel/Deity.Anathema.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.Anathema Property + +Анафемы божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString Anathema { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.AreaOfConcern.md b/Documentation/Pf2eModel/Deity.AreaOfConcern.md new file mode 100644 index 0000000..c9780cb --- /dev/null +++ b/Documentation/Pf2eModel/Deity.AreaOfConcern.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.AreaOfConcern Property + +Область покровительства божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString AreaOfConcern { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.Category.md b/Documentation/Pf2eModel/Deity.Category.md index f8a5e1b..f98d269 100644 --- a/Documentation/Pf2eModel/Deity.Category.md +++ b/Documentation/Pf2eModel/Deity.Category.md @@ -3,11 +3,11 @@ ## Deity\.Category Property -Тип божества\. +Категория божества\. ```csharp -public Pf2eModel.Model.Enum.DeityCategory Category { get; set; } +public string Category { get; set; } ``` #### Property Value -[DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Enum\.DeityCategory') \ No newline at end of file +[System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.DeityAttributes.md b/Documentation/Pf2eModel/Deity.DeityAttributes.md index 0a3a3c8..bf4f453 100644 --- a/Documentation/Pf2eModel/Deity.DeityAttributes.md +++ b/Documentation/Pf2eModel/Deity.DeityAttributes.md @@ -3,7 +3,7 @@ ## Deity\.DeityAttributes Property -Аттрибуты божества\. +Атрибуты божества\. ```csharp public System.Collections.Generic.ICollection DeityAttributes { get; set; } diff --git a/Documentation/Pf2eModel/Deity.Edicts.md b/Documentation/Pf2eModel/Deity.Edicts.md new file mode 100644 index 0000000..01c3894 --- /dev/null +++ b/Documentation/Pf2eModel/Deity.Edicts.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.Edicts Property + +Заветы божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString Edicts { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.ReligiousSymbol.md b/Documentation/Pf2eModel/Deity.ReligiousSymbol.md new file mode 100644 index 0000000..657a57c --- /dev/null +++ b/Documentation/Pf2eModel/Deity.ReligiousSymbol.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.ReligiousSymbol Property + +Религиозный символ божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString ReligiousSymbol { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.SacredAnimal.md b/Documentation/Pf2eModel/Deity.SacredAnimal.md new file mode 100644 index 0000000..74ca8b7 --- /dev/null +++ b/Documentation/Pf2eModel/Deity.SacredAnimal.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.SacredAnimal Property + +Священное животное божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString SacredAnimal { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.Type.md b/Documentation/Pf2eModel/Deity.Type.md new file mode 100644 index 0000000..58b161f --- /dev/null +++ b/Documentation/Pf2eModel/Deity.Type.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.Type Property + +Тип божества\. + +```csharp +public Pf2eModel.Model.Enum.DeityType Type { get; set; } +``` + +#### Property Value +[DeityType](DeityType.md 'Pf2eModel\.Model\.Enum\.DeityType') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.md b/Documentation/Pf2eModel/Deity.md index 8d755f2..8a76fd6 100644 --- a/Documentation/Pf2eModel/Deity.md +++ b/Documentation/Pf2eModel/Deity.md @@ -15,14 +15,20 @@ Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity') | Properties | | | :--- | :--- | -| [Category](Deity.Category.md 'Pf2eModel\.Model\.Structure\.Deity\.Category') | Тип божества\. | -| [DeityAttributes](Deity.DeityAttributes.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityAttributes') | Аттрибуты божества\. | +| [Anathema](Deity.Anathema.md 'Pf2eModel\.Model\.Structure\.Deity\.Anathema') | Анафемы божества\. | +| [AreaOfConcern](Deity.AreaOfConcern.md 'Pf2eModel\.Model\.Structure\.Deity\.AreaOfConcern') | Область покровительства божества\. | +| [Category](Deity.Category.md 'Pf2eModel\.Model\.Structure\.Deity\.Category') | Категория божества\. | +| [DeityAttributes](Deity.DeityAttributes.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityAttributes') | Атрибуты божества\. | | [DeityDomains](Deity.DeityDomains.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityDomains') | Домены божества\. | | [DeitySpells](Deity.DeitySpells.md 'Pf2eModel\.Model\.Structure\.Deity\.DeitySpells') | Заклинания божества\. | | [DeityWeapons](Deity.DeityWeapons.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityWeapons') | Оружия божества\. | +| [Edicts](Deity.Edicts.md 'Pf2eModel\.Model\.Structure\.Deity\.Edicts') | Заветы божества\. | | [Entity](Deity.Entity.md 'Pf2eModel\.Model\.Structure\.Deity\.Entity') | Корневая сущность\. | | [Fonts](Deity.Fonts.md 'Pf2eModel\.Model\.Structure\.Deity\.Fonts') | Тип божественный силы\. | | [Id](Deity.Id.md 'Pf2eModel\.Model\.Structure\.Deity\.Id') | Идентификатор сущности\. | +| [ReligiousSymbol](Deity.ReligiousSymbol.md 'Pf2eModel\.Model\.Structure\.Deity\.ReligiousSymbol') | Религиозный символ божества\. | +| [SacredAnimal](Deity.SacredAnimal.md 'Pf2eModel\.Model\.Structure\.Deity\.SacredAnimal') | Священное животное божества\. | | [Sanctification](Deity.Sanctification.md 'Pf2eModel\.Model\.Structure\.Deity\.Sanctification') | Тип освящения\. | | [SanctificationMust](Deity.SanctificationMust.md 'Pf2eModel\.Model\.Structure\.Deity\.SanctificationMust') | Обязательное освящение\. | | [Skills](Deity.Skills.md 'Pf2eModel\.Model\.Structure\.Deity\.Skills') | Навыки божества\. | +| [Type](Deity.Type.md 'Pf2eModel\.Model\.Structure\.Deity\.Type') | Тип божества\. | diff --git a/Documentation/Pf2eModel/DeityAttribute.Id.md b/Documentation/Pf2eModel/DeityAttribute.Id.md new file mode 100644 index 0000000..dc7a330 --- /dev/null +++ b/Documentation/Pf2eModel/DeityAttribute.Id.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure\.DeityRelation](Pf2eModel.Model.Structure.DeityRelation.md 'Pf2eModel\.Model\.Structure\.DeityRelation').[DeityAttribute](DeityAttribute.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute') + +## DeityAttribute\.Id Property + +Идентификатор\. + +```csharp +public int Id { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityAttribute.md b/Documentation/Pf2eModel/DeityAttribute.md index 6a95a78..1b60532 100644 --- a/Documentation/Pf2eModel/DeityAttribute.md +++ b/Documentation/Pf2eModel/DeityAttribute.md @@ -16,3 +16,4 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | [Attribute](DeityAttribute.Attribute.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.Attribute') | Атрибут божества\. | | [Deity](DeityAttribute.Deity.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.Deity') | Божество, к которому относится атрибут\. | | [DeityId](DeityAttribute.DeityId.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.DeityId') | Идентификатор божества\. | +| [Id](DeityAttribute.Id.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.Id') | Идентификатор\. | diff --git a/Documentation/Pf2eModel/DeityCategory.md b/Documentation/Pf2eModel/DeityCategory.md deleted file mode 100644 index d2921b6..0000000 --- a/Documentation/Pf2eModel/DeityCategory.md +++ /dev/null @@ -1,35 +0,0 @@ -#### [Pf2eModel](index.md 'index') -### [Pf2eModel\.Model\.Enum](Pf2eModel.Model.Enum.md 'Pf2eModel\.Model\.Enum') - -## DeityCategory Enum - -Тип божества\. - -```csharp -public enum DeityCategory -``` -### Fields - - - -`Deity` 0 - -Божество\. - - - -`Pantheon` 1 - -Пантеон\. - - - -`Covenant` 2 - -Ковенант\. - - - -`Philosophy` 3 - -Философия\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityType.md b/Documentation/Pf2eModel/DeityType.md new file mode 100644 index 0000000..20cc55b --- /dev/null +++ b/Documentation/Pf2eModel/DeityType.md @@ -0,0 +1,35 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Enum](Pf2eModel.Model.Enum.md 'Pf2eModel\.Model\.Enum') + +## DeityType Enum + +Тип божества\. + +```csharp +public enum DeityType +``` +### Fields + + + +`Deity` 0 + +Божество\. + + + +`Pantheon` 1 + +Пантеон\. + + + +`Covenant` 2 + +Ковенант\. + + + +`Philosophy` 3 + +Философия\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md b/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md index 58eb4e3..46a4240 100644 --- a/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md +++ b/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md @@ -11,9 +11,9 @@ | [AttributeValues](AttributeValues.md 'Pf2eModel\.Model\.Enum\.AttributeValues') | Перечисление значений атрибутов\. | | [ClassProgressionType](ClassProgressionType.md 'Pf2eModel\.Model\.Enum\.ClassProgressionType') | Тип элемента прогрессии класса\. | | [ConditionGroup](ConditionGroup.md 'Pf2eModel\.Model\.Enum\.ConditionGroup') | Тип состояния | -| [DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Enum\.DeityCategory') | Тип божества\. | | [DeityFonts](DeityFonts.md 'Pf2eModel\.Model\.Enum\.DeityFonts') | Тип божественной силы\. | | [DeitySanctification](DeitySanctification.md 'Pf2eModel\.Model\.Enum\.DeitySanctification') | Тип освящения божества\. | +| [DeityType](DeityType.md 'Pf2eModel\.Model\.Enum\.DeityType') | Тип божества\. | | [ElementEnum](ElementEnum.md 'Pf2eModel\.Model\.Enum\.ElementEnum') | Перечисление элементов\. | | [EntityRarity](EntityRarity.md 'Pf2eModel\.Model\.Enum\.EntityRarity') | Перечисление редкости сущности\. | | [EntityType](EntityType.md 'Pf2eModel\.Model\.Enum\.EntityType') | Тип сущности\. | diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs index db7124d..70ea28d 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs @@ -7,6 +7,7 @@ using Pf2eDataScrapper.Processors; using Pf2eDataScrapper.Processors.Attributes; using Pf2eModel; using Pf2eModel.Model.Common; +using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure; using Pf2eModel.Model.Structure.DeityRelation; @@ -44,14 +45,10 @@ internal partial class DeityProcessor( base.Process(); // Установка категории божества - Object.Category = Input.EnumRequired("deity_category"); + Object.Category = Input.GetRequired("deity_category"); - // Обработка божественной силы ProcessFonts(); - // Обработка освящения - ProcessSanctification(); - // Обработка атрибутов ProcessAttributes(); @@ -66,6 +63,17 @@ internal partial class DeityProcessor( // Обработка навыков ProcessSkills(); + + // Обработка текстов описания + ProcessTexts(); + + // Обработка освящения - в Foundry! + } + + /// + protected override void AddTraits() + { + // У божеств нет признаков. Не знаю, зачем они на Архивах. } /// @@ -96,68 +104,6 @@ internal partial class DeityProcessor( } } - /// - /// Обработка освящения. - /// - private void ProcessSanctification() - { - // Получаем выравнивание божества - string? deityAlignment = Input.GetOptional("alignment"); - - // По умолчанию любое освящение - Object.Sanctification = DeitySanctification.Any; - Object.SanctificationMust = false; - - // Определяем освящение на основе выравнивания божества - if (!string.IsNullOrEmpty(deityAlignment)) - { - switch (deityAlignment) - { - case "LG": - case "NG": - case "CG": - Object.Sanctification = DeitySanctification.Holy; - break; - case "LE": - case "NE": - case "CE": - Object.Sanctification = DeitySanctification.Unholy; - break; - case "N": - case "LN": - case "CN": - case "Any": - Object.Sanctification = DeitySanctification.Any; - break; - } - } - - // Проверяем, требует ли божество определенного выравнивания от последователей - JArray? followerAlignments = Input.GetOptional("follower_alignment"); - if (followerAlignments != null && followerAlignments.Count > 0) - { - // Если выравнивание последователей ограничено, то освящение обязательно - Object.SanctificationMust = true; - - // Если освящение Any, но выравнивания последователей ограничены только добрыми или злыми, - // уточняем тип освящения - if (Object.Sanctification == DeitySanctification.Any) - { - bool allGood = followerAlignments.All(a => a.ToString() is "LG" or "NG" or "CG"); - bool allEvil = followerAlignments.All(a => a.ToString() is "LE" or "NE" or "CE"); - - if (allGood) - { - Object.Sanctification = DeitySanctification.Holy; - } - else if (allEvil) - { - Object.Sanctification = DeitySanctification.Unholy; - } - } - } - } - /// /// Обработка атрибутов божества. /// @@ -226,7 +172,6 @@ internal partial class DeityProcessor( string spellsMarkdown = Input.GetRequired("spell_markdown"); MatchCollection matches = MarkdownLinkRegex().Matches(spellsMarkdown); - int level = 1; foreach (Match match in matches) { string spellName = match.Groups[1].Value; @@ -243,11 +188,10 @@ internal partial class DeityProcessor( { Deity = Object, Spell = spell, - Level = level, + Level = spell.Level, } ); } - level++; } } @@ -290,6 +234,24 @@ internal partial class DeityProcessor( } } + /// + /// Обработка текстов описания божества. + /// + private void ProcessTexts() + { + Object.Edicts[LocaleType.English] = Input.GetRequired("edict"); + Object.Anathema[LocaleType.English] = Input.GetRequired("anathema"); + Object.ReligiousSymbol[LocaleType.English] = Input.GetOptional( + "religious_symbol", + "" + ); + Object.SacredAnimal[LocaleType.English] = Input.GetOptional("sacred_animal", ""); + Object.AreaOfConcern[LocaleType.English] = Input.GetOptional( + "area_of_concern_raw", + "" + ); + } + /// /// Регулярное выражение для извлечения названия из markdown-ссылки. /// diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs new file mode 100644 index 0000000..f42fad7 --- /dev/null +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Pf2eDataScrapper.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Subclasses; +using Pf2eDataScrapper.Processors.Attributes; +using Pf2eDataScrapper.Processors.Definitions; +using Pf2eDataScrapper.Processors.Factory; +using Pf2eModel; +using Pf2eModel.Model.Base; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure; + +namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; + +[ProcessorFactory( + "aonprd:trait-alignments", + ProcessorType = typeof(TraitAlignmentsProcessor), + Description = "Трейты мировоззрений", + Group = ProcessorGroupEnum.AonprdPreparation, + Parallel = false +)] +internal class TraitAlignmentsProcessorFactory(IServiceProvider serviceProvider) + : AbstractProcessorFactory +{ + public IServiceProvider ServiceProvider { get; } = serviceProvider; + public List Alignments { get; } = ["LG", "NG", "CG", "LN", "N", "CN", "LE", "NE", "CE"]; + + public override int Count() + { + return Alignments.Count; + } + + public override IEnumerable> GetEnumerator() + { + foreach (string alignment in Alignments) + { + TraitAlignmentsProcessor processor = + ActivatorUtilities.CreateInstance( + ServiceProvider, + alignment + ); + + yield return new($"{alignment}", processor); + } + } +} + +internal class TraitAlignmentsProcessor( + string alignment, + DatabaseHelper helper, + AonprdBuilderGlobals globals +) : IProcessor +{ + public string Alignment { get; } = alignment; + public DatabaseHelper Helper { get; } = helper; + public AonprdBuilderGlobals Globals { get; } = globals; + public Pf2eDbContext Context { get; } = new(); + + public Entity Entity { get; set; } = null!; + public Trait Trait { get; set; } = null!; + + public void Process() + { + Entity = new() + { + Name = new() { ["en"] = Alignment }, + Type = EntityType.Trait, + Img = "", + Description = "", + Rarity = EntityRarity.Common, + IsTranslated = false, + IsChecked = false, + Slug = Helper.GenerateSlug(Alignment), + }; + + Trait = new() { Entity = Entity, Type = TraitType.Alignment }; + } + + public void Save() + { + Context.Entities.Add(Entity); + Context.Traits.Add(Trait); + + Globals.TraitIds[Alignment] = Entity.Id; + } +} diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs index 0d179ff..78238a3 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs @@ -16,7 +16,9 @@ namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; Description = "Признаки", Group = ProcessorGroupEnum.AonprdEntities )] -[ProcessorDependencies(["aonprd:external", "aonprd:source"])] +[ProcessorDependencies( + ["aonprd:external", "aonprd:source", "aonprd:source", "aonprd:trait-alignments"] +)] internal class TraitProcessor( ProcessorInput input, StringHelper stringHelper, diff --git a/Pf2eModel/Migrations/20250913084534_1.Designer.cs b/Pf2eModel/Migrations/20250914093120_1.Designer.cs similarity index 97% rename from Pf2eModel/Migrations/20250913084534_1.Designer.cs rename to Pf2eModel/Migrations/20250914093120_1.Designer.cs index ba9d372..f1f5f0a 100644 --- a/Pf2eModel/Migrations/20250913084534_1.Designer.cs +++ b/Pf2eModel/Migrations/20250914093120_1.Designer.cs @@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum; namespace Pf2eModel.Migrations { [DbContext(typeof(Pf2eDbContext))] - [Migration("20250913084534_1")] + [Migration("20250914093120_1")] partial class _1 { /// @@ -29,9 +29,9 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "abilities", "attitudes", "death", "detection", "senses", "unknown" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_category", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "any", "harm", "heal", "none" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); @@ -44,7 +44,7 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "any", "damage", "healing" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "all", "arcane", "divine", "elemental", "none", "occult", "primal" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "expert", "legendary", "master", "mythic", "trained", "untrained" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "class", "regular", "tradition" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "alignment", "class", "regular", "tradition" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -1128,30 +1128,72 @@ namespace Pf2eModel.Migrations .HasColumnOrder(1) .HasComment("Идентификатор"); - b.Property("Category") - .HasColumnType("deity_category") + b.Property("Anathema") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("anathema") + .HasColumnOrder(8) + .HasComment("Анафемы божества"); + + b.Property("AreaOfConcern") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("area_of_concern") + .HasColumnOrder(11) + .HasComment("Область покровительства божества"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text") .HasColumnName("category") - .HasColumnOrder(2) - .HasComment("Тип божества"); + .HasColumnOrder(3) + .HasComment("Категория божества"); + + b.Property("Edicts") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("edicts") + .HasColumnOrder(7) + .HasComment("Заветы божества"); b.Property("Fonts") .HasColumnType("deity_fonts") .HasColumnName("fonts") - .HasColumnOrder(3) + .HasColumnOrder(4) .HasComment("Тип божественной силы"); + b.Property("ReligiousSymbol") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("religious_symbol") + .HasColumnOrder(9) + .HasComment("Религиозный символ божества"); + + b.Property("SacredAnimal") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("sacred_animal") + .HasColumnOrder(10) + .HasComment("Священное животное божества"); + b.Property("Sanctification") .HasColumnType("deity_sanctification") .HasColumnName("sanctification") - .HasColumnOrder(4) + .HasColumnOrder(5) .HasComment("Тип освящения"); b.Property("SanctificationMust") .HasColumnType("boolean") .HasColumnName("sanctification_must") - .HasColumnOrder(5) + .HasColumnOrder(6) .HasComment("Обязательное освящение"); + b.Property("Type") + .HasColumnType("deity_type") + .HasColumnName("type") + .HasColumnOrder(2) + .HasComment("Тип божества"); + b.HasKey("Id") .HasName("pk_deities"); @@ -1160,21 +1202,33 @@ namespace Pf2eModel.Migrations modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b => { - b.Property("DeityId") + b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("integer") - .HasColumnName("deity_id") + .HasColumnName("id") .HasColumnOrder(1) - .HasComment("Идентификатор божества"); + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Attribute") .HasColumnType("attribute_values") .HasColumnName("attribute") - .HasColumnOrder(2) + .HasColumnOrder(3) .HasComment("Атрибут божества"); - b.HasKey("DeityId", "Attribute") + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.HasKey("Id") .HasName("pk_deity_attributes"); + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_attributes_deity_id"); + b.ToTable("deity_attributes", (string)null); }); diff --git a/Pf2eModel/Migrations/20250913084534_1.cs b/Pf2eModel/Migrations/20250914093120_1.cs similarity index 98% rename from Pf2eModel/Migrations/20250913084534_1.cs rename to Pf2eModel/Migrations/20250914093120_1.cs index cbb6fd7..face626 100644 --- a/Pf2eModel/Migrations/20250913084534_1.cs +++ b/Pf2eModel/Migrations/20250914093120_1.cs @@ -19,9 +19,9 @@ namespace Pf2eModel.Migrations .Annotation("Npgsql:Enum:attribute_values", "cha,con,dex,free,int,str,wis") .Annotation("Npgsql:Enum:class_progression_type", "ancestry_feat,attribute_increase,class_feat,entity,general_feat,skill_feat,skill_increase") .Annotation("Npgsql:Enum:condition_group", "abilities,attitudes,death,detection,senses,unknown") - .Annotation("Npgsql:Enum:deity_category", "covenant,deity,pantheon,philosophy") .Annotation("Npgsql:Enum:deity_fonts", "any,harm,heal,none") .Annotation("Npgsql:Enum:deity_sanctification", "any,holy,unholy") + .Annotation("Npgsql:Enum:deity_type", "covenant,deity,pantheon,philosophy") .Annotation("Npgsql:Enum:element_enum", "air,earth,fire,metal,universal,water,wood") .Annotation("Npgsql:Enum:entity_rarity", "common,rare,uncommon,unique") .Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,domain,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown") @@ -34,7 +34,7 @@ namespace Pf2eModel.Migrations .Annotation("Npgsql:Enum:spell_damage_kinds", "any,damage,healing") .Annotation("Npgsql:Enum:spell_tradition", "all,arcane,divine,elemental,none,occult,primal") .Annotation("Npgsql:Enum:training_rank", "expert,legendary,master,mythic,trained,untrained") - .Annotation("Npgsql:Enum:trait_type", "class,regular,tradition") + .Annotation("Npgsql:Enum:trait_type", "alignment,class,regular,tradition") .Annotation("Npgsql:Enum:vision_enum", "dark-vision,low-light-vision,normal"); migrationBuilder.CreateTable( @@ -234,10 +234,16 @@ namespace Pf2eModel.Migrations columns: table => new { id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), - category = table.Column(type: "deity_category", nullable: false, comment: "Тип божества"), + type = table.Column(type: "deity_type", nullable: false, comment: "Тип божества"), + category = table.Column(type: "text", nullable: false, comment: "Категория божества"), fonts = table.Column(type: "deity_fonts", nullable: false, comment: "Тип божественной силы"), sanctification = table.Column(type: "deity_sanctification", nullable: false, comment: "Тип освящения"), - sanctification_must = table.Column(type: "boolean", nullable: false, comment: "Обязательное освящение") + sanctification_must = table.Column(type: "boolean", nullable: false, comment: "Обязательное освящение"), + edicts = table.Column(type: "jsonb", nullable: false, comment: "Заветы божества"), + anathema = table.Column(type: "jsonb", nullable: false, comment: "Анафемы божества"), + religious_symbol = table.Column(type: "jsonb", nullable: false, comment: "Религиозный символ божества"), + sacred_animal = table.Column(type: "jsonb", nullable: false, comment: "Священное животное божества"), + area_of_concern = table.Column(type: "jsonb", nullable: false, comment: "Область покровительства божества") }, constraints: table => { @@ -778,12 +784,14 @@ namespace Pf2eModel.Migrations name: "deity_attributes", columns: table => new { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), attribute = table.Column(type: "attribute_values", nullable: false, comment: "Атрибут божества") }, constraints: table => { - table.PrimaryKey("pk_deity_attributes", x => new { x.deity_id, x.attribute }); + table.PrimaryKey("pk_deity_attributes", x => x.id); table.ForeignKey( name: "fk_deity_attributes_deities_deity_id", column: x => x.deity_id, @@ -1320,6 +1328,11 @@ namespace Pf2eModel.Migrations table: "class_trainings", column: "training_id"); + migrationBuilder.CreateIndex( + name: "ix_deity_attributes_deity_id", + table: "deity_attributes", + column: "deity_id"); + migrationBuilder.CreateIndex( name: "ix_deity_domains_deity_id", table: "deity_domains", diff --git a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs index 55354e5..b8e292c 100644 --- a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs +++ b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs @@ -26,9 +26,9 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "abilities", "attitudes", "death", "detection", "senses", "unknown" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_category", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "any", "harm", "heal", "none" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); @@ -41,7 +41,7 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "any", "damage", "healing" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "all", "arcane", "divine", "elemental", "none", "occult", "primal" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "expert", "legendary", "master", "mythic", "trained", "untrained" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "class", "regular", "tradition" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "alignment", "class", "regular", "tradition" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -1125,30 +1125,72 @@ namespace Pf2eModel.Migrations .HasColumnOrder(1) .HasComment("Идентификатор"); - b.Property("Category") - .HasColumnType("deity_category") + b.Property("Anathema") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("anathema") + .HasColumnOrder(8) + .HasComment("Анафемы божества"); + + b.Property("AreaOfConcern") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("area_of_concern") + .HasColumnOrder(11) + .HasComment("Область покровительства божества"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text") .HasColumnName("category") - .HasColumnOrder(2) - .HasComment("Тип божества"); + .HasColumnOrder(3) + .HasComment("Категория божества"); + + b.Property("Edicts") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("edicts") + .HasColumnOrder(7) + .HasComment("Заветы божества"); b.Property("Fonts") .HasColumnType("deity_fonts") .HasColumnName("fonts") - .HasColumnOrder(3) + .HasColumnOrder(4) .HasComment("Тип божественной силы"); + b.Property("ReligiousSymbol") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("religious_symbol") + .HasColumnOrder(9) + .HasComment("Религиозный символ божества"); + + b.Property("SacredAnimal") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("sacred_animal") + .HasColumnOrder(10) + .HasComment("Священное животное божества"); + b.Property("Sanctification") .HasColumnType("deity_sanctification") .HasColumnName("sanctification") - .HasColumnOrder(4) + .HasColumnOrder(5) .HasComment("Тип освящения"); b.Property("SanctificationMust") .HasColumnType("boolean") .HasColumnName("sanctification_must") - .HasColumnOrder(5) + .HasColumnOrder(6) .HasComment("Обязательное освящение"); + b.Property("Type") + .HasColumnType("deity_type") + .HasColumnName("type") + .HasColumnOrder(2) + .HasComment("Тип божества"); + b.HasKey("Id") .HasName("pk_deities"); @@ -1157,21 +1199,33 @@ namespace Pf2eModel.Migrations modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b => { - b.Property("DeityId") + b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("integer") - .HasColumnName("deity_id") + .HasColumnName("id") .HasColumnOrder(1) - .HasComment("Идентификатор божества"); + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Attribute") .HasColumnType("attribute_values") .HasColumnName("attribute") - .HasColumnOrder(2) + .HasColumnOrder(3) .HasComment("Атрибут божества"); - b.HasKey("DeityId", "Attribute") + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.HasKey("Id") .HasName("pk_deity_attributes"); + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_attributes_deity_id"); + b.ToTable("deity_attributes", (string)null); }); diff --git a/Pf2eModel/Model/Enum/DeityCategory.cs b/Pf2eModel/Model/Enum/DeityType.cs similarity index 95% rename from Pf2eModel/Model/Enum/DeityCategory.cs rename to Pf2eModel/Model/Enum/DeityType.cs index 995d56a..487c781 100644 --- a/Pf2eModel/Model/Enum/DeityCategory.cs +++ b/Pf2eModel/Model/Enum/DeityType.cs @@ -5,7 +5,7 @@ namespace Pf2eModel.Model.Enum; /// /// Тип божества. /// -public enum DeityCategory +public enum DeityType { /// /// Божество. diff --git a/Pf2eModel/Model/Structure/Deity.cs b/Pf2eModel/Model/Structure/Deity.cs index 58dc4ba..7774a7d 100644 --- a/Pf2eModel/Model/Structure/Deity.cs +++ b/Pf2eModel/Model/Structure/Deity.cs @@ -30,56 +30,70 @@ public class Deity : IEntity /// [Column(Order = 2)] [Comment("Тип божества")] - public DeityCategory Category { get; set; } + public DeityType Type { get; set; } + + /// + /// Категория божества. + /// + [Column(Order = 3)] + [Comment("Категория божества")] + public string Category { get; set; } = null!; /// /// Тип божественный силы. /// - [Column(Order = 3)] + [Column(Order = 4)] [Comment("Тип божественной силы")] public DeityFonts Fonts { get; set; } /// /// Тип освящения. /// - [Column(Order = 4)] + [Column(Order = 5)] [Comment("Тип освящения")] public DeitySanctification Sanctification { get; set; } /// /// Обязательное освящение. /// - [Column(Order = 5)] + [Column(Order = 6)] [Comment("Обязательное освящение")] public bool SanctificationMust { get; set; } /// /// Заветы божества. /// - [Column(Order = 6)] + [Column(Order = 7)] [Comment("Заветы божества")] - public LocaleString Edicts { get; set; } = null!; + public LocaleString Edicts { get; set; } = []; /// /// Анафемы божества. /// - [Column(Order = 7)] + [Column(Order = 8)] [Comment("Анафемы божества")] - public LocaleString Anathema { get; set; } = null!; + public LocaleString Anathema { get; set; } = []; /// /// Религиозный символ божества. /// - [Column(Order = 8)] + [Column(Order = 9)] [Comment("Религиозный символ божества")] - public LocaleString ReligiousSymbol { get; set; } = null!; + public LocaleString ReligiousSymbol { get; set; } = []; /// /// Священное животное божества. /// - [Column(Order = 9)] + [Column(Order = 10)] [Comment("Священное животное божества")] - public LocaleString SacredAnimal { get; set; } = null!; + public LocaleString SacredAnimal { get; set; } = []; + + /// + /// Область покровительства божества. + /// + [Column(Order = 11)] + [Comment("Область покровительства божества")] + public LocaleString AreaOfConcern { get; set; } = []; /// /// Атрибуты божества. diff --git a/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs b/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs index 776e702..12515b5 100644 --- a/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs +++ b/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs @@ -1,4 +1,5 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Enum; @@ -7,20 +8,28 @@ namespace Pf2eModel.Model.Structure.DeityRelation; /// /// Элемент отношения божества и атрибута. /// -[PrimaryKey(nameof(DeityId), nameof(Attribute))] public class DeityAttribute { + /// + /// Идентификатор. + /// + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column(Order = 1)] + [Comment("Идентификатор")] + public int Id { get; set; } + /// /// Идентификатор божества. /// - [Column(Order = 1)] + [Column(Order = 2)] [Comment("Идентификатор божества")] public int DeityId { get; set; } /// /// Атрибут божества. /// - [Column(Order = 2)] + [Column(Order = 3)] [Comment("Атрибут божества")] public AttributeValues Attribute { get; set; } diff --git a/Pf2eModel/Pf2eDbContext.cs b/Pf2eModel/Pf2eDbContext.cs index 442853a..e816d5e 100644 --- a/Pf2eModel/Pf2eDbContext.cs +++ b/Pf2eModel/Pf2eDbContext.cs @@ -163,7 +163,7 @@ public partial class Pf2eDbContext : DbContext .MapEnum() .MapEnum() .MapEnum() - .MapEnum() + .MapEnum() .MapEnum() .MapEnum() .MapEnum() diff --git a/Pf2eModel/Pf2eDbContextModel.cs b/Pf2eModel/Pf2eDbContextModel.cs index d343fb6..904d549 100644 --- a/Pf2eModel/Pf2eDbContextModel.cs +++ b/Pf2eModel/Pf2eDbContextModel.cs @@ -438,6 +438,7 @@ public partial class Pf2eDbContext BindLocaleString(entity, d => d.Edicts); BindLocaleString(entity, d => d.ReligiousSymbol); BindLocaleString(entity, d => d.SacredAnimal); + BindLocaleString(entity, d => d.AreaOfConcern); entity .HasMany(e => e.DeityAttributes)