Продолжение работы

This commit is contained in:
2025-05-22 17:40:49 +04:00
parent 64c05a393f
commit 8ff9f6bbc6
20 changed files with 382 additions and 127 deletions
@@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Migrations
{
[DbContext(typeof(Pf2eDbContext))]
[Migration("20250521155437_1")]
[Migration("20250522130215_1")]
partial class _1
{
/// <inheritdoc />
@@ -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", "unknown" });
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_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" });
@@ -548,10 +548,16 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(2)
.HasComment("Количество действий");
b.Property<ActionCategory>("Category")
.HasColumnType("action_category")
.HasColumnName("category")
.HasColumnOrder(3)
.HasComment("Категория действия");
b.Property<string>("Extra")
.HasColumnType("text")
.HasColumnName("extra")
.HasColumnOrder(3)
.HasColumnOrder(4)
.HasComment("Дополнительная информация");
b.HasKey("Id")
@@ -1239,8 +1245,8 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(1)
.HasComment("Идентификатор");
b.Property<int?>("Actions")
.HasColumnType("integer")
b.Property<ActionEnum>("Actions")
.HasColumnType("action_enum")
.HasColumnName("actions")
.HasColumnOrder(5)
.HasComment("Количество действий");
@@ -1254,35 +1260,15 @@ namespace Pf2eModel.Migrations
b.Property<string>("Extra")
.HasColumnType("text")
.HasColumnName("extra")
.HasColumnOrder(10)
.HasColumnOrder(6)
.HasComment("Дополнительная информация");
b.Property<bool>("IsFreeAction")
.HasColumnType("boolean")
.HasColumnName("is_free_action")
.HasColumnOrder(8);
b.Property<bool>("IsPassive")
.HasColumnType("boolean")
.HasColumnName("is_passive")
.HasColumnOrder(9);
b.Property<bool>("IsReaction")
.HasColumnType("boolean")
.HasColumnName("is_reaction")
.HasColumnOrder(7);
b.Property<int>("Level")
.HasColumnType("integer")
.HasColumnName("level")
.HasColumnOrder(4)
.HasComment("Уровень способности");
b.Property<int?>("MaxActions")
.HasColumnType("integer")
.HasColumnName("max_actions")
.HasColumnOrder(6);
b.HasKey("Id")
.HasName("pk_feats");
@@ -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,unknown")
.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_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")
@@ -136,6 +136,7 @@ namespace Pf2eModel.Migrations
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
actions = table.Column<ActionEnum>(type: "action_enum", nullable: false, comment: "Количество действий"),
category = table.Column<ActionCategory>(type: "action_category", nullable: false, comment: "Категория действия"),
extra = table.Column<string>(type: "text", nullable: true, comment: "Дополнительная информация")
},
constraints: table =>
@@ -275,11 +276,7 @@ namespace Pf2eModel.Migrations
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
category = table.Column<FeatCategory>(type: "feat_category", nullable: false, comment: "Категория способности"),
level = table.Column<int>(type: "integer", nullable: false, comment: "Уровень способности"),
actions = table.Column<int>(type: "integer", nullable: true, comment: "Количество действий"),
max_actions = table.Column<int>(type: "integer", nullable: true),
is_reaction = table.Column<bool>(type: "boolean", nullable: false),
is_free_action = table.Column<bool>(type: "boolean", nullable: false),
is_passive = table.Column<bool>(type: "boolean", nullable: false),
actions = table.Column<ActionEnum>(type: "action_enum", nullable: false, comment: "Количество действий"),
extra = table.Column<string>(type: "text", nullable: true, comment: "Дополнительная информация")
},
constraints: table =>
@@ -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", "unknown" });
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_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" });
@@ -545,10 +545,16 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(2)
.HasComment("Количество действий");
b.Property<ActionCategory>("Category")
.HasColumnType("action_category")
.HasColumnName("category")
.HasColumnOrder(3)
.HasComment("Категория действия");
b.Property<string>("Extra")
.HasColumnType("text")
.HasColumnName("extra")
.HasColumnOrder(3)
.HasColumnOrder(4)
.HasComment("Дополнительная информация");
b.HasKey("Id")
@@ -1236,8 +1242,8 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(1)
.HasComment("Идентификатор");
b.Property<int?>("Actions")
.HasColumnType("integer")
b.Property<ActionEnum>("Actions")
.HasColumnType("action_enum")
.HasColumnName("actions")
.HasColumnOrder(5)
.HasComment("Количество действий");
@@ -1251,35 +1257,15 @@ namespace Pf2eModel.Migrations
b.Property<string>("Extra")
.HasColumnType("text")
.HasColumnName("extra")
.HasColumnOrder(10)
.HasColumnOrder(6)
.HasComment("Дополнительная информация");
b.Property<bool>("IsFreeAction")
.HasColumnType("boolean")
.HasColumnName("is_free_action")
.HasColumnOrder(8);
b.Property<bool>("IsPassive")
.HasColumnType("boolean")
.HasColumnName("is_passive")
.HasColumnOrder(9);
b.Property<bool>("IsReaction")
.HasColumnType("boolean")
.HasColumnName("is_reaction")
.HasColumnOrder(7);
b.Property<int>("Level")
.HasColumnType("integer")
.HasColumnName("level")
.HasColumnOrder(4)
.HasComment("Уровень способности");
b.Property<int?>("MaxActions")
.HasColumnType("integer")
.HasColumnName("max_actions")
.HasColumnOrder(6);
b.HasKey("Id")
.HasName("pk_feats");
+3
View File
@@ -19,6 +19,9 @@ public enum ActionCategory
[PgName("archetype")]
Archetype,
[PgName("skill-action")]
SkillAction,
[PgName("class-feature")]
ClassFeature,
+8 -1
View File
@@ -30,9 +30,16 @@ public class Action : IEntity
public ActionEnum Actions { get; set; } = ActionEnum.Unknown;
/// <summary>
/// Дополнительная информация.
/// Категория действия.
/// </summary>
[Column(Order = 3)]
[Comment("Категория действия")]
public ActionCategory Category { get; set; } = ActionCategory.Unknown;
/// <summary>
/// Дополнительная информация.
/// </summary>
[Column(Order = 4)]
[Comment("Дополнительная информация")]
public string? Extra { get; set; }
}
+5 -14
View File
@@ -37,26 +37,17 @@ public class Feat : IEntity
[Comment("Уровень способности")]
public int Level { get; set; }
/// <summary>
/// Количество действий, необходимых для применения фита.
/// </summary>
[Column(Order = 5)]
[Comment("Количество действий")]
public int? Actions { get; set; } = null;
[Column(Order = 6)]
public int? MaxActions { get; set; } = null;
[Column(Order = 7)]
public bool IsReaction { get; set; } = false;
[Column(Order = 8)]
public bool IsFreeAction { get; set; } = false;
[Column(Order = 9)]
public bool IsPassive { get; set; } = false;
public ActionEnum Actions { get; set; } = ActionEnum.Other;
/// <summary>
/// Дополнительная информация.
/// </summary>
[Column(Order = 10)]
[Column(Order = 6)]
[Comment("Дополнительная информация")]
public string? Extra { get; set; }