Подготовка изменений

This commit is contained in:
2025-09-13 11:39:23 +04:00
parent 843d0a4aa3
commit 776abeb58a
10 changed files with 94 additions and 28 deletions
@@ -3,11 +3,11 @@
## Class\.Spellcasting Property ## Class\.Spellcasting Property
Флаг, указывающий на то, что класс является заклинательным\. Указание на тип заклинательства\.
```csharp ```csharp
public bool Spellcasting { get; set; } public Pf2eModel.Model.Enum.SpellcastingType Spellcasting { get; set; }
``` ```
#### Property Value #### Property Value
[System\.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System\.Boolean') [SpellcastingType](SpellcastingType.md 'Pf2eModel\.Model\.Enum\.SpellcastingType')
+1 -1
View File
@@ -22,6 +22,6 @@ Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity')
| [Entity](Class.Entity.md 'Pf2eModel\.Model\.Structure\.Class\.Entity') | Корневая сущность\. | | [Entity](Class.Entity.md 'Pf2eModel\.Model\.Structure\.Class\.Entity') | Корневая сущность\. |
| [Hp](Class.Hp.md 'Pf2eModel\.Model\.Structure\.Class\.Hp') | Количество очков здоровья\. | | [Hp](Class.Hp.md 'Pf2eModel\.Model\.Structure\.Class\.Hp') | Количество очков здоровья\. |
| [Id](Class.Id.md 'Pf2eModel\.Model\.Structure\.Class\.Id') | Идентификатор сущности\. | | [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') | Группы подклассов\. | | [SubclassGroups](Class.SubclassGroups.md 'Pf2eModel\.Model\.Structure\.Class\.SubclassGroups') | Группы подклассов\. |
| [Tradition](Class.Tradition.md 'Pf2eModel\.Model\.Structure\.Class\.Tradition') | Традиция заклинаний класса\. | | [Tradition](Class.Tradition.md 'Pf2eModel\.Model\.Structure\.Class\.Tradition') | Традиция заклинаний класса\. |
@@ -21,6 +21,7 @@
| [SizeEnum](SizeEnum.md 'Pf2eModel\.Model\.Enum\.SizeEnum') | Размер\. | | [SizeEnum](SizeEnum.md 'Pf2eModel\.Model\.Enum\.SizeEnum') | Размер\. |
| [SourceCategory](SourceCategory.md 'Pf2eModel\.Model\.Enum\.SourceCategory') | Перечисление категорий источников\. | | [SourceCategory](SourceCategory.md 'Pf2eModel\.Model\.Enum\.SourceCategory') | Перечисление категорий источников\. |
| [SpellAreaType](SpellAreaType.md 'Pf2eModel\.Model\.Enum\.SpellAreaType') | Тип области заклинания\. | | [SpellAreaType](SpellAreaType.md 'Pf2eModel\.Model\.Enum\.SpellAreaType') | Тип области заклинания\. |
| [SpellcastingType](SpellcastingType.md 'Pf2eModel\.Model\.Enum\.SpellcastingType') | Перечисление типа применения заклинаний\. |
| [SpellDamageCategory](SpellDamageCategory.md 'Pf2eModel\.Model\.Enum\.SpellDamageCategory') | Тип урона заклинания\. | | [SpellDamageCategory](SpellDamageCategory.md 'Pf2eModel\.Model\.Enum\.SpellDamageCategory') | Тип урона заклинания\. |
| [SpellDamageKinds](SpellDamageKinds.md 'Pf2eModel\.Model\.Enum\.SpellDamageKinds') | Тип урона заклинания\. | | [SpellDamageKinds](SpellDamageKinds.md 'Pf2eModel\.Model\.Enum\.SpellDamageKinds') | Тип урона заклинания\. |
| [SpellTradition](SpellTradition.md 'Pf2eModel\.Model\.Enum\.SpellTradition') | Традиция заклинания\. | | [SpellTradition](SpellTradition.md 'Pf2eModel\.Model\.Enum\.SpellTradition') | Традиция заклинания\. |
@@ -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
<a name='Pf2eModel.Model.Enum.SpellcastingType.None'></a>
`None` 0
Не применяет заклинания\.
<a name='Pf2eModel.Model.Enum.SpellcastingType.Prepared'></a>
`Prepared` 1
Заготавливаемое заклинательство\.
<a name='Pf2eModel.Model.Enum.SpellcastingType.Spontaneous'></a>
`Spontaneous` 2
Спонтанное заклинательство\.
@@ -7,7 +7,6 @@ using Pf2eDataScrapper.Helpers;
using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers;
using Pf2eDataScrapper.Processors; using Pf2eDataScrapper.Processors;
using Pf2eDataScrapper.Processors.Attributes; using Pf2eDataScrapper.Processors.Attributes;
using Pf2eDataScrapper.Processors.Collection;
using Pf2eModel; using Pf2eModel;
using Pf2eModel.Model.Common; using Pf2eModel.Model.Common;
using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Common.I18n;
@@ -88,15 +87,12 @@ internal partial class ClassProcessor(
switch (tradition.Count) switch (tradition.Count)
{ {
case 0: case 0:
Object.Spellcasting = false;
Object.Tradition = SpellTradition.None; Object.Tradition = SpellTradition.None;
break; break;
case 1: case 1:
Object.Spellcasting = true;
Object.Tradition = Input.Enum<SpellTradition>(tradition[0].ToString()); Object.Tradition = Input.Enum<SpellTradition>(tradition[0].ToString());
break; break;
default: default:
Object.Spellcasting = true;
Object.Tradition = SpellTradition.All; Object.Tradition = SpellTradition.All;
break; break;
} }
@@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Migrations namespace Pf2eModel.Migrations
{ {
[DbContext(typeof(Pf2eDbContext))] [DbContext(typeof(Pf2eDbContext))]
[Migration("20250602061959_1")] [Migration("20250913071004_1")]
partial class _1 partial class _1
{ {
/// <inheritdoc /> /// <inheritdoc />
@@ -24,7 +24,7 @@ namespace Pf2eModel.Migrations
.HasAnnotation("ProductVersion", "9.0.4") .HasAnnotation("ProductVersion", "9.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .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, "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, "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, "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") .HasColumnType("boolean")
.HasColumnName("is_checked") .HasColumnName("is_checked")
.HasColumnOrder(9) .HasColumnOrder(9)
.HasComment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи"); .HasComment("Проверено?");
b.Property<bool?>("IsLegacy")
.HasColumnType("boolean")
.HasColumnName("is_legacy")
.HasColumnOrder(10)
.HasComment("Устаревшая?");
b.Property<bool?>("IsTranslated") b.Property<bool?>("IsTranslated")
.HasColumnType("boolean") .HasColumnType("boolean")
.HasColumnName("is_translated") .HasColumnName("is_translated")
.HasColumnOrder(8) .HasColumnOrder(8)
.HasComment("Флаг, указывающий, что у сущности существует перевод"); .HasComment("Есть перевод?");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
@@ -890,11 +896,11 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(2) .HasColumnOrder(2)
.HasComment("Количество очков здоровья"); .HasComment("Количество очков здоровья");
b.Property<bool>("Spellcasting") b.Property<int>("Spellcasting")
.HasColumnType("boolean") .HasColumnType("integer")
.HasColumnName("spellcasting") .HasColumnName("spellcasting")
.HasColumnOrder(3) .HasColumnOrder(3)
.HasComment("Заклинатель?"); .HasComment("Тип заклинательства");
b.Property<SpellTradition?>("Tradition") b.Property<SpellTradition?>("Tradition")
.HasColumnType("spell_tradition") .HasColumnType("spell_tradition")
@@ -14,7 +14,7 @@ namespace Pf2eModel.Migrations
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.AlterDatabase() 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: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: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: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<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Изображение объекта"), img = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Изображение объекта"),
description = table.Column<string>(type: "text", nullable: false, comment: "Текстовое описание сущности"), description = table.Column<string>(type: "text", nullable: false, comment: "Текстовое описание сущности"),
rarity = table.Column<EntityRarity>(type: "entity_rarity", nullable: false, comment: "Редкость сущности"), rarity = table.Column<EntityRarity>(type: "entity_rarity", nullable: false, comment: "Редкость сущности"),
is_translated = table.Column<bool>(type: "boolean", nullable: true, comment: "Флаг, указывающий, что у сущности существует перевод"), is_translated = table.Column<bool>(type: "boolean", nullable: true, comment: "Есть перевод?"),
is_checked = table.Column<bool>(type: "boolean", nullable: true, comment: "Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи") is_checked = table.Column<bool>(type: "boolean", nullable: true, comment: "Проверено?"),
is_legacy = table.Column<bool>(type: "boolean", nullable: true, comment: "Устаревшая?")
}, },
constraints: table => constraints: table =>
{ {
@@ -194,7 +195,7 @@ namespace Pf2eModel.Migrations
{ {
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"), id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
hp = table.Column<int>(type: "integer", nullable: false, comment: "Количество очков здоровья"), hp = table.Column<int>(type: "integer", nullable: false, comment: "Количество очков здоровья"),
spellcasting = table.Column<bool>(type: "boolean", nullable: false, comment: "Заклинатель?"), spellcasting = table.Column<int>(type: "integer", nullable: false, comment: "Тип заклинательства"),
tradition = table.Column<SpellTradition>(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"), tradition = table.Column<SpellTradition>(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"),
additional_trained_skills = table.Column<int>(type: "integer", nullable: false, comment: "Дополнительные навыки") additional_trained_skills = table.Column<int>(type: "integer", nullable: false, comment: "Дополнительные навыки")
}, },
@@ -21,7 +21,7 @@ namespace Pf2eModel.Migrations
.HasAnnotation("ProductVersion", "9.0.4") .HasAnnotation("ProductVersion", "9.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .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, "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, "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, "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") .HasColumnType("boolean")
.HasColumnName("is_checked") .HasColumnName("is_checked")
.HasColumnOrder(9) .HasColumnOrder(9)
.HasComment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи"); .HasComment("Проверено?");
b.Property<bool?>("IsLegacy")
.HasColumnType("boolean")
.HasColumnName("is_legacy")
.HasColumnOrder(10)
.HasComment("Устаревшая?");
b.Property<bool?>("IsTranslated") b.Property<bool?>("IsTranslated")
.HasColumnType("boolean") .HasColumnType("boolean")
.HasColumnName("is_translated") .HasColumnName("is_translated")
.HasColumnOrder(8) .HasColumnOrder(8)
.HasComment("Флаг, указывающий, что у сущности существует перевод"); .HasComment("Есть перевод?");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
@@ -887,11 +893,11 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(2) .HasColumnOrder(2)
.HasComment("Количество очков здоровья"); .HasComment("Количество очков здоровья");
b.Property<bool>("Spellcasting") b.Property<int>("Spellcasting")
.HasColumnType("boolean") .HasColumnType("integer")
.HasColumnName("spellcasting") .HasColumnName("spellcasting")
.HasColumnOrder(3) .HasColumnOrder(3)
.HasComment("Заклинатель?"); .HasComment("Тип заклинательства");
b.Property<SpellTradition?>("Tradition") b.Property<SpellTradition?>("Tradition")
.HasColumnType("spell_tradition") .HasColumnType("spell_tradition")
+27
View File
@@ -0,0 +1,27 @@
using NpgsqlTypes;
namespace Pf2eModel.Model.Enum;
/// <summary>
/// Перечисление типа применения заклинаний.
/// </summary>
public enum SpellcastingType
{
/// <summary>
/// Не применяет заклинания.
/// </summary>
[PgName("none")]
None,
/// <summary>
/// Заготавливаемое заклинательство.
/// </summary>
[PgName("prepared")]
Prepared,
/// <summary>
/// Спонтанное заклинательство.
/// </summary>
[PgName("spontaneous")]
Spontaneous,
}
+3 -3
View File
@@ -31,11 +31,11 @@ public class Class : IEntity
public int Hp { get; set; } public int Hp { get; set; }
/// <summary> /// <summary>
/// Флаг, указывающий на то, что класс является заклинательным. /// Указание на тип заклинательства.
/// </summary> /// </summary>
[Column(Order = 3)] [Column(Order = 3)]
[Comment("Заклинатель?")] [Comment("Тип заклинательства")]
public bool Spellcasting { get; set; } public SpellcastingType Spellcasting { get; set; } = SpellcastingType.None;
/// <summary> /// <summary>
/// Традиция заклинаний класса. /// Традиция заклинаний класса.