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)