diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Helpers/AonprdEnumResolver.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Helpers/AonprdEnumResolver.cs index f503a86..809ead1 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Helpers/AonprdEnumResolver.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Helpers/AonprdEnumResolver.cs @@ -18,11 +18,11 @@ public static class AonprdEnumResolver { "Society", SourceCategory.Society }, } ), - new Solver( + new Solver( new() { - { "Low-Light Vision", AncestryVision.LowLightVision }, - { "Darkvision", AncestryVision.DarkVision }, + { "Low-Light VisionEnum", VisionEnum.LowLightVision }, + { "Darkvision", VisionEnum.DarkVision }, } ), new Solver( diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/AncestryProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/AncestryProcessor.cs index 8ae626a..8f9d2a3 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/AncestryProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/AncestryProcessor.cs @@ -26,7 +26,7 @@ internal class AncestryProcessor(AonprdProcessorInput input) : AbstractEntityPro Object.Size = Input .GetRequired("size") - .Select(t => Input.Enum(t.ToString())) + .Select(t => Input.Enum(t.ToString())) .ToArray(); string hp = Input.GetRequired("hp_raw"); @@ -34,7 +34,7 @@ internal class AncestryProcessor(AonprdProcessorInput input) : AbstractEntityPro Object.Speed = Convert.ToInt32(Input.GetOptional("speed.land")); - Object.Vision = Input.EnumOptional("vision", AncestryVision.Normal); + Object.VisionEnum = Input.EnumOptional("vision", VisionEnum.Normal); AddBoosts("attribute", true); AddBoosts("attribute_flaw", false); diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/FeatProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/FeatProcessor.cs index e5c9b40..c818911 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/FeatProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/DataBuilder/Processors/Types/FeatProcessor.cs @@ -21,8 +21,8 @@ internal class FeatProcessor(AonprdProcessorInput input) : AbstractEntityProcess Object.Level = Input.GetRequired("level"); Object.Category = Entity.Traits.Any(t => t.Type == TraitType.Class) - ? ActionCategory.ClassFeat - : ActionCategory.Unknown; + ? FeatCategory.Class + : FeatCategory.Uncategorized; AonprdProcessorInput.ActionStruct action = Input.ResolveActionString( Input.GetOptional("actions") ?? "" @@ -54,7 +54,7 @@ internal class FeatProcessor(AonprdProcessorInput input) : AbstractEntityProcess if (archetypes.Length != 0) { - Object.Category = ActionCategory.Archetype; + Object.Category = FeatCategory.Archetype; } foreach (Archetype archetype in archetypes) diff --git a/Pf2eModel/EntityOfTypeAttribute.cs b/Pf2eModel/EntityOfTypeAttribute.cs index 6a41600..6e11122 100644 --- a/Pf2eModel/EntityOfTypeAttribute.cs +++ b/Pf2eModel/EntityOfTypeAttribute.cs @@ -1,15 +1,30 @@ -using System.Reflection; +using System.ComponentModel; +using System.Reflection; using Pf2eModel.Model; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel; +/// +/// Аттрибут, указывающий тип сущности. +/// +/// Тип сущности. [AttributeUsage(AttributeTargets.Class)] public class EntityOfTypeAttribute(EntityType type) : Attribute { + /// + /// Тип сущности. + /// public EntityType Type { get; } = type; + /// + /// Метод для получения программного типа сущности по её типу. + /// + /// Тип сущности. + /// Программный тип сущности. + /// Если есть ошибка в структурах. + /// Тип сущности. public static Type Resolve(Entity entity) { foreach (Type type in Assembly.GetExecutingAssembly().GetTypes()) @@ -21,7 +36,7 @@ public class EntityOfTypeAttribute(EntityType type) : Attribute if (!type.IsAssignableTo(typeof(IEntity))) { - throw new Exception( + throw new( $"'EntityOfTypeAttribute' attribute should only be applied to children of 'IEntity' class. '{type.FullName}' is not." ); } @@ -34,6 +49,8 @@ public class EntityOfTypeAttribute(EntityType type) : Attribute } } - throw new Exception($"Can't resolve class associated with '{entity.Type}' EntityType."); + throw new InvalidEnumArgumentException( + $"Can't resolve class associated with '{entity.Type}' EntityType." + ); } } diff --git a/Pf2eModel/Migrations/20250508101742_1.Designer.cs b/Pf2eModel/Migrations/20250510202833_1.Designer.cs similarity index 86% rename from Pf2eModel/Migrations/20250508101742_1.Designer.cs rename to Pf2eModel/Migrations/20250510202833_1.Designer.cs index bb35ad4..396cb60 100644 --- a/Pf2eModel/Migrations/20250508101742_1.Designer.cs +++ b/Pf2eModel/Migrations/20250510202833_1.Designer.cs @@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum; namespace Pf2eModel.Migrations { [DbContext(typeof(Pf2eDbContext))] - [Migration("20250508101742_1")] + [Migration("20250510202833_1")] partial class _1 { /// @@ -24,28 +24,28 @@ namespace Pf2eModel.Migrations .HasAnnotation("ProductVersion", "9.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "unknown", "archetype", "class-feature", "class-feat", "offensive", "defensive", "interaction", "familiar", "army_tactic", "army_war_action", "kingdom_activity", "kingdom_feat", "kingdom_feature" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_enum", new[] { "unknown", "1", "2", "3", "reaction", "free", "passive", "other", "1-3", "1-2", "2-3", "2/2 rounds", "reaction/1", "reaction/2", "reaction/3", "free/1", "1 minute", "5 minutes", "10 minutes", "30 minutes", "1 hour" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ancestry_vision", new[] { "normal", "low-light-vision", "dark-vision" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "free", "str", "dex", "con", "int", "wis", "cha" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "entity", "ancestry_feat", "class_feat", "general_feat", "skill_feat", "skill_increase" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "unknown", "senses", "abilities", "death", "attitudes", "detection" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_category", new[] { "deity", "pantheon", "covenant", "philosophy" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "none", "heal", "harm", "any" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "holy", "unholy", "any" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "uncommon", "rare", "unique" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "unknown", "trait", "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "subclass_group", "subclass", "condition", "deity", "feat", "heritage", "spell", "ritual", "language", "rule" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_action_type", new[] { "passive", "action", "reaction", "free" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "uncategorized", "ancestry-feature", "class-feature", "calling", "class", "skill", "general", "ancestry", "bonus", "deityboon", "curse", "pfsboon", "campaign-feature" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "legacy_english", "russian", "legacy", "hobby", "other" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size", new[] { "tiny", "small", "medium", "large" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "source_category", new[] { "rulebook", "adventure-path", "lost-omens", "adventures", "comics", "blog-posts", "society" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_area_type", new[] { "burst", "emanation", "cone", "line", "square", "cube", "cylinder", "varies", "cuboid", "circle", "other" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "persistent", "splash" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "damage", "healing", "any" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "none", "divine", "occult", "arcane", "primal", "elemental", "all" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "untrained", "trained", "expert", "master", "legendary", "mythic" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "regular", "class", "tradition" }); + 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_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" }); + 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, "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, "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", "legacy", "legacy_english", "other", "russian" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "source_category", new[] { "adventure-path", "adventures", "blog-posts", "comics", "lost-omens", "rulebook", "society" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_area_type", new[] { "burst", "circle", "cone", "cube", "cuboid", "cylinder", "emanation", "line", "other", "square", "varies" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "normal", "persistent", "splash" }); + 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, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("DeityTraining", b => @@ -120,7 +120,7 @@ namespace Pf2eModel.Migrations .HasColumnType("text") .HasColumnName("description") .HasColumnOrder(6) - .HasComment("Текстовое описание объекта"); + .HasComment("Текстовое описание сущности"); b.Property("Img") .IsRequired() @@ -134,13 +134,13 @@ namespace Pf2eModel.Migrations .HasColumnType("boolean") .HasColumnName("is_checked") .HasColumnOrder(9) - .HasComment("Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи"); + .HasComment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи"); b.Property("IsTranslated") .HasColumnType("boolean") .HasColumnName("is_translated") .HasColumnOrder(8) - .HasComment("Флаг, указывающий, что у объекта существует перевод"); + .HasComment("Флаг, указывающий, что у сущности существует перевод"); b.Property("Name") .IsRequired() @@ -152,7 +152,8 @@ namespace Pf2eModel.Migrations b.Property("Rarity") .HasColumnType("entity_rarity") .HasColumnName("rarity") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Редкость сущности"); b.Property("Slug") .IsRequired() @@ -166,7 +167,7 @@ namespace Pf2eModel.Migrations .HasColumnType("entity_type") .HasColumnName("type") .HasColumnOrder(3) - .HasComment("Тип объекта"); + .HasComment("Тип сущности"); b.HasKey("Id") .HasName("pk_entities"); @@ -188,14 +189,16 @@ namespace Pf2eModel.Migrations .IsRequired() .HasColumnType("jsonb") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); b.Property("Slug") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("slug") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Часть имени в URL"); b.HasKey("Id") .HasName("pk_keywords"); @@ -209,21 +212,24 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("KeywordId") .HasColumnType("integer") .HasColumnName("keyword_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор ключевого слова"); b.Property("Value") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("value") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Синоним"); b.HasKey("Id") .HasName("pk_keyword_aliases"); @@ -240,14 +246,16 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(0); + .HasColumnOrder(0) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("EntityId") .HasColumnType("integer") .HasColumnName("entity_id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); b.Property("IsRemaster") .HasColumnType("boolean") @@ -258,7 +266,8 @@ namespace Pf2eModel.Migrations b.Property("SourceId") .HasColumnType("integer") .HasColumnName("source_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор источника"); b.Property("Suffix") .IsRequired() @@ -286,26 +295,30 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Category") .HasColumnType("source_category") .HasColumnName("category") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Категория источника"); b.Property("Name") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); b.Property("ReleaseDate") .HasColumnType("date") .HasColumnName("release_date") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Дата выхода источника"); b.HasKey("Id") .HasName("pk_sources"); @@ -318,12 +331,14 @@ namespace Pf2eModel.Migrations b.Property("EntityId") .HasColumnType("integer") .HasColumnName("entity_id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); b.Property("TargetId") .HasColumnType("integer") .HasColumnName("target_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор цели"); b.Property("Md5") .IsRequired() @@ -331,7 +346,7 @@ namespace Pf2eModel.Migrations .HasColumnType("character varying(32)") .HasColumnName("md5") .HasColumnOrder(5) - .HasComment("Контроль версии объекта"); + .HasComment("Контрольная сумма объекта"); b.Property("Suffix") .IsRequired() @@ -356,7 +371,8 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); @@ -365,21 +381,24 @@ namespace Pf2eModel.Migrations .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("icon") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Иконка цели"); b.Property("Name") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); b.Property("Prefix") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("prefix") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Префикс для URL-адреса внешней ссылки"); b.HasKey("Id") .HasName("pk_external_targets"); @@ -393,24 +412,28 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Max") .HasColumnType("integer") .HasColumnName("max") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Максимальная продолжительсность"); b.Property("Per") .HasColumnType("integer") .HasColumnName("per") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Частота использования"); b.Property("Value") .HasColumnType("integer") .HasColumnName("value") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Значение использования"); b.HasKey("Id") .HasName("pk_frequencies"); @@ -424,7 +447,8 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); @@ -432,12 +456,14 @@ namespace Pf2eModel.Migrations .IsRequired() .HasColumnType("jsonb") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Название способности"); b.Property("Type") .HasColumnType("integer") .HasColumnName("type") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Тип способности"); b.HasKey("Id") .HasName("pk_trainings"); @@ -450,17 +476,20 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Actions") .HasColumnType("action_enum") .HasColumnName("actions") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Количество действий"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); b.HasKey("Id") .HasName("pk_actions"); @@ -473,28 +502,33 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Hp") .HasColumnType("integer") .HasColumnName("hp") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Количество очков здоровья"); - b.PrimitiveCollection("Size") + b.PrimitiveCollection("Size") .IsRequired() - .HasColumnType("size[]") + .HasColumnType("size_enum[]") .HasColumnName("size") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Размеры родословной"); b.Property("Speed") .HasColumnType("integer") .HasColumnName("speed") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Скорость передвижения"); - b.Property("Vision") - .HasColumnType("ancestry_vision") - .HasColumnName("vision") - .HasColumnOrder(5); + b.Property("VisionEnum") + .HasColumnType("vision_enum") + .HasColumnName("vision_enum") + .HasColumnOrder(5) + .HasComment("Тип зрения"); b.HasKey("Id") .HasName("pk_ancestries"); @@ -593,22 +627,26 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("DedicationFeatId") .HasColumnType("integer") .HasColumnName("dedication_feat_id") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("ID посвящения"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Дополнительная информация"); b.Property("Level") .HasColumnType("integer") .HasColumnName("level") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Уровень"); b.HasKey("Id") .HasName("pk_archetypes"); @@ -644,7 +682,8 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.HasKey("Id") .HasName("pk_backgrounds"); @@ -746,32 +785,32 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("AdditionalTrainedSkills") .HasColumnType("integer") .HasColumnName("additional_trained_skills") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Дополнительные навыки"); b.Property("Hp") .HasColumnType("integer") .HasColumnName("hp") - .HasColumnOrder(3); - - b.Property("Perception") - .HasColumnType("integer") - .HasColumnName("perception") - .HasColumnOrder(4); + .HasColumnOrder(2) + .HasComment("Количество очков здоровья"); b.Property("Spellcasting") .HasColumnType("boolean") .HasColumnName("spellcasting") - .HasColumnOrder(5); + .HasColumnOrder(3) + .HasComment("Заклинатель?"); - b.Property("Tradition") + b.Property("Tradition") .HasColumnType("spell_tradition") .HasColumnName("tradition") - .HasColumnOrder(6); + .HasColumnOrder(6) + .HasComment("Традиция заклинаний"); b.HasKey("Id") .HasName("pk_classes"); @@ -948,17 +987,20 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); b.Property("Group") .HasColumnType("condition_group") .HasColumnName("group") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Группа состояния"); b.HasKey("Id") .HasName("pk_conditions"); @@ -971,27 +1013,32 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Category") .HasColumnType("deity_category") .HasColumnName("category") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Тип божества"); b.Property("Fonts") .HasColumnType("deity_fonts") .HasColumnName("fonts") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Тип божественной силы"); b.Property("Sanctification") .HasColumnType("deity_sanctification") .HasColumnName("sanctification") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Тип освящения"); b.Property("SanctificationMust") .HasColumnType("boolean") .HasColumnName("sanctification_must") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Обязательное освящение"); b.HasKey("Id") .HasName("pk_deities"); @@ -1126,22 +1173,26 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Actions") .HasColumnType("integer") .HasColumnName("actions") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Количество действий"); - b.Property("Category") - .HasColumnType("action_category") + b.Property("Category") + .HasColumnType("feat_category") .HasColumnName("category") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Категория способности"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(10); + .HasColumnOrder(10) + .HasComment("Дополнительная информация"); b.Property("IsFreeAction") .HasColumnType("boolean") @@ -1161,7 +1212,8 @@ namespace Pf2eModel.Migrations b.Property("Level") .HasColumnType("integer") .HasColumnName("level") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Уровень способности"); b.Property("MaxActions") .HasColumnType("integer") @@ -1210,12 +1262,14 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("AncestryId") .HasColumnType("integer") .HasColumnName("ancestry_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор родословной"); b.HasKey("Id") .HasName("pk_heritages"); @@ -1229,12 +1283,10 @@ namespace Pf2eModel.Migrations modelBuilder.Entity("Pf2eModel.Model.Structure.Language", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("EntityId") .HasColumnType("integer") @@ -1254,7 +1306,8 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("CastTime") .HasColumnType("integer") @@ -1265,7 +1318,8 @@ namespace Pf2eModel.Migrations b.Property("Cost") .HasColumnType("jsonb") .HasColumnName("cost") - .HasColumnOrder(14); + .HasColumnOrder(14) + .HasComment("Стоимость ритуала"); b.Property("Duration") .HasColumnType("integer") @@ -1273,61 +1327,72 @@ namespace Pf2eModel.Migrations .HasColumnOrder(4) .HasComment("Время действия эффекта ритуала в секундах"); - b.PrimitiveCollection("Elements") + b.PrimitiveCollection("Elements") .IsRequired() - .HasColumnType("integer[]") + .HasColumnType("element_enum[]") .HasColumnName("elements") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Элементы ритуала"); b.Property("Level") .HasColumnType("integer") .HasColumnName("level") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Уровень ритуала"); b.Property("PrimaryCheckRank") .HasColumnType("training_rank") .HasColumnName("primary_check_rank") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Ранг основной проверки"); b.Property("PrimaryCheckSuffix") .HasColumnType("jsonb") .HasColumnName("primary_check_suffix") - .HasColumnOrder(8); + .HasColumnOrder(8) + .HasComment("Дополнительная информация об основной проверки"); b.Property("Range") .HasColumnType("integer") .HasColumnName("range") - .HasColumnOrder(6); + .HasColumnOrder(6) + .HasComment("Дальнность ритуала"); b.Property("RangeString") .HasColumnType("jsonb") .HasColumnName("range_string") - .HasColumnOrder(12); + .HasColumnOrder(12) + .HasComment("Дальность ритуала"); b.Property("Requirement") .HasColumnType("jsonb") .HasColumnName("requirement") - .HasColumnOrder(15); + .HasColumnOrder(15) + .HasComment("Требования к ритуалу"); b.Property("SecondaryCasters") .HasColumnType("integer") .HasColumnName("secondary_casters") - .HasColumnOrder(9); + .HasColumnOrder(9) + .HasComment("Количество дополнительных заклинателей"); b.Property("SecondaryCastersMax") .HasColumnType("integer") .HasColumnName("secondary_casters_max") - .HasColumnOrder(10); + .HasColumnOrder(10) + .HasComment("Максимальное количество дополнительных заклинателей"); b.Property("SecondaryCastersSuffix") .HasColumnType("jsonb") .HasColumnName("secondary_casters_suffix") - .HasColumnOrder(11); + .HasColumnOrder(11) + .HasComment("Дополнительная информация о дополнительных заклинателях"); b.Property("Target") .HasColumnType("jsonb") .HasColumnName("target") - .HasColumnOrder(13); + .HasColumnOrder(13) + .HasComment("Цель ритуала"); b.HasKey("Id") .HasName("pk_rituals"); @@ -1411,7 +1476,8 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.PrimitiveCollection("Breadcrumbs") .IsRequired() @@ -1421,12 +1487,14 @@ namespace Pf2eModel.Migrations b.Property("Order") .HasColumnType("integer") .HasColumnName("order") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Порядок отображения"); b.Property("ParentId") .HasColumnType("integer") .HasColumnName("parent_id") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Родительского правило"); b.HasKey("Id") .HasName("pk_rules"); @@ -1442,34 +1510,40 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Actions") .HasColumnType("action_enum") .HasColumnName("actions") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Количество действий"); b.Property("Cost") .HasColumnType("jsonb") .HasColumnName("cost") - .HasColumnOrder(11); + .HasColumnOrder(11) + .HasComment("Стоимость заклинания"); b.Property("Duration") .HasMaxLength(255) .HasColumnType("integer") .HasColumnName("duration") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Время длительности заклинания"); - b.PrimitiveCollection("Elements") + b.PrimitiveCollection("Elements") .IsRequired() - .HasColumnType("integer[]") + .HasColumnType("element_enum[]") .HasColumnName("elements") - .HasColumnOrder(8); + .HasColumnOrder(8) + .HasComment("Элементы заклинания"); b.Property("IsFocus") .HasColumnType("boolean") .HasColumnName("is_focus") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Фокус?"); b.Property("Level") .HasColumnType("integer") @@ -1479,28 +1553,33 @@ namespace Pf2eModel.Migrations b.Property("Range") .HasColumnType("integer") .HasColumnName("range") - .HasColumnOrder(6); + .HasColumnOrder(6) + .HasComment("Дальность заклинания"); b.Property("Requirement") .HasColumnType("jsonb") .HasColumnName("requirement") - .HasColumnOrder(12); + .HasColumnOrder(12) + .HasComment("Требования к заклинанию"); b.Property("Target") .HasColumnType("jsonb") .HasColumnName("target") - .HasColumnOrder(10); + .HasColumnOrder(10) + .HasComment("Цель заклинания"); b.PrimitiveCollection("Traditions") .IsRequired() .HasColumnType("spell_tradition[]") .HasColumnName("traditions") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Традиции заклинания"); b.Property("Trigger") .HasColumnType("jsonb") .HasColumnName("trigger") - .HasColumnOrder(9); + .HasColumnOrder(9) + .HasComment("Триггер заклинания"); b.HasKey("Id") .HasName("pk_spells"); @@ -1655,13 +1734,15 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Additional") .IsRequired() .HasColumnType("jsonb") .HasColumnName("additional") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); b.Property("Extra") .IsRequired() @@ -1672,7 +1753,8 @@ namespace Pf2eModel.Migrations b.Property("GroupId") .HasColumnType("integer") .HasColumnName("group_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Группа подклассов"); b.HasKey("Id") .HasName("pk_subclasses"); @@ -1688,12 +1770,14 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("ClassId") .HasColumnType("integer") .HasColumnName("class_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор класса"); b.HasKey("Id") .HasName("pk_subclass_groups"); @@ -1709,12 +1793,14 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Type") .HasColumnType("trait_type") .HasColumnName("type") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Тип признака"); b.HasKey("Id") .HasName("pk_traits"); diff --git a/Pf2eModel/Migrations/20250508101742_1.cs b/Pf2eModel/Migrations/20250510202833_1.cs similarity index 87% rename from Pf2eModel/Migrations/20250508101742_1.cs rename to Pf2eModel/Migrations/20250510202833_1.cs index 2cf0e26..dfcb326 100644 --- a/Pf2eModel/Migrations/20250508101742_1.cs +++ b/Pf2eModel/Migrations/20250510202833_1.cs @@ -14,28 +14,28 @@ namespace Pf2eModel.Migrations protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() - .Annotation("Npgsql:Enum:action_category", "unknown,archetype,class-feature,class-feat,offensive,defensive,interaction,familiar,army_tactic,army_war_action,kingdom_activity,kingdom_feat,kingdom_feature") - .Annotation("Npgsql:Enum:action_enum", "unknown,1,2,3,reaction,free,passive,other,1-3,1-2,2-3,2/2 rounds,reaction/1,reaction/2,reaction/3,free/1,1 minute,5 minutes,10 minutes,30 minutes,1 hour") - .Annotation("Npgsql:Enum:ancestry_vision", "normal,low-light-vision,dark-vision") - .Annotation("Npgsql:Enum:attribute_values", "free,str,dex,con,int,wis,cha") - .Annotation("Npgsql:Enum:class_progression_type", "entity,ancestry_feat,class_feat,general_feat,skill_feat,skill_increase") - .Annotation("Npgsql:Enum:condition_group", "unknown,senses,abilities,death,attitudes,detection") - .Annotation("Npgsql:Enum:deity_category", "deity,pantheon,covenant,philosophy") - .Annotation("Npgsql:Enum:deity_fonts", "none,heal,harm,any") - .Annotation("Npgsql:Enum:deity_sanctification", "holy,unholy,any") - .Annotation("Npgsql:Enum:entity_rarity", "common,uncommon,rare,unique") - .Annotation("Npgsql:Enum:entity_type", "unknown,trait,action,ancestry,archetype,background,backpack,campaign_feature,class,subclass_group,subclass,condition,deity,feat,heritage,spell,ritual,language,rule") - .Annotation("Npgsql:Enum:feat_action_type", "passive,action,reaction,free") - .Annotation("Npgsql:Enum:feat_category", "uncategorized,ancestry-feature,class-feature,calling,class,skill,general,ancestry,bonus,deityboon,curse,pfsboon,campaign-feature") - .Annotation("Npgsql:Enum:locale_type", "english,legacy_english,russian,legacy,hobby,other") - .Annotation("Npgsql:Enum:size", "tiny,small,medium,large") - .Annotation("Npgsql:Enum:source_category", "rulebook,adventure-path,lost-omens,adventures,comics,blog-posts,society") - .Annotation("Npgsql:Enum:spell_area_type", "burst,emanation,cone,line,square,cube,cylinder,varies,cuboid,circle,other") - .Annotation("Npgsql:Enum:spell_damage_category", "persistent,splash") - .Annotation("Npgsql:Enum:spell_damage_kinds", "damage,healing,any") - .Annotation("Npgsql:Enum:spell_tradition", "none,divine,occult,arcane,primal,elemental,all") - .Annotation("Npgsql:Enum:training_rank", "untrained,trained,expert,master,legendary,mythic") - .Annotation("Npgsql:Enum:trait_type", "regular,class,tradition"); + .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_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") + .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: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: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,legacy,legacy_english,other,russian") + .Annotation("Npgsql:Enum:size_enum", "huge,large,medium,small,tiny") + .Annotation("Npgsql:Enum:source_category", "adventure-path,adventures,blog-posts,comics,lost-omens,rulebook,society") + .Annotation("Npgsql:Enum:spell_area_type", "burst,circle,cone,cube,cuboid,cylinder,emanation,line,other,square,varies") + .Annotation("Npgsql:Enum:spell_damage_category", "normal,persistent,splash") + .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:vision_enum", "dark-vision,low-light-vision,normal"); migrationBuilder.CreateTable( name: "entities", @@ -44,13 +44,13 @@ namespace Pf2eModel.Migrations id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), name = table.Column(type: "jsonb", nullable: false, comment: "Отображаемое имя"), - type = table.Column(type: "entity_type", nullable: false, comment: "Тип объекта"), + type = table.Column(type: "entity_type", nullable: false, comment: "Тип сущности"), slug = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть имени в URL"), 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), - is_translated = table.Column(type: "boolean", nullable: true, comment: "Флаг, указывающий, что у объекта существует перевод"), - is_checked = table.Column(type: "boolean", nullable: true, 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: "Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи") }, constraints: table => { @@ -61,11 +61,11 @@ namespace Pf2eModel.Migrations name: "external_targets", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), - icon = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), - prefix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отображаемое имя"), + icon = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Иконка цели"), + prefix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Префикс для URL-адреса внешней ссылки") }, constraints: table => { @@ -76,11 +76,11 @@ namespace Pf2eModel.Migrations name: "frequencies", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - max = table.Column(type: "integer", nullable: false), - per = table.Column(type: "integer", nullable: false), - value = table.Column(type: "integer", nullable: true) + max = table.Column(type: "integer", nullable: false, comment: "Максимальная продолжительсность"), + per = table.Column(type: "integer", nullable: false, comment: "Частота использования"), + value = table.Column(type: "integer", nullable: true, comment: "Значение использования") }, constraints: table => { @@ -93,8 +93,8 @@ namespace Pf2eModel.Migrations { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - name = table.Column(type: "jsonb", nullable: false), - slug = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + name = table.Column(type: "jsonb", nullable: false, comment: "Отображаемое имя"), + slug = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть имени в URL") }, constraints: table => { @@ -105,11 +105,11 @@ namespace Pf2eModel.Migrations name: "sources", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), - category = table.Column(type: "source_category", nullable: false), - release_date = table.Column(type: "date", nullable: true) + name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отображаемое имя"), + category = table.Column(type: "source_category", nullable: false, comment: "Категория источника"), + release_date = table.Column(type: "date", nullable: true, comment: "Дата выхода источника") }, constraints: table => { @@ -120,10 +120,10 @@ namespace Pf2eModel.Migrations name: "trainings", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - name = table.Column(type: "jsonb", nullable: false), - type = table.Column(type: "integer", nullable: false) + name = table.Column(type: "jsonb", nullable: false, comment: "Название способности"), + type = table.Column(type: "integer", nullable: false, comment: "Тип способности") }, constraints: table => { @@ -134,9 +134,9 @@ namespace Pf2eModel.Migrations name: "actions", columns: table => new { - id = table.Column(type: "integer", nullable: false), - actions = table.Column(type: "action_enum", nullable: false), - extra = table.Column(type: "text", nullable: true) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + actions = table.Column(type: "action_enum", nullable: false, comment: "Количество действий"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") }, constraints: table => { @@ -153,11 +153,11 @@ namespace Pf2eModel.Migrations name: "ancestries", columns: table => new { - id = table.Column(type: "integer", nullable: false), - size = table.Column(type: "size[]", nullable: false), - hp = table.Column(type: "integer", nullable: false), - speed = table.Column(type: "integer", nullable: false), - vision = table.Column(type: "ancestry_vision", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + size = table.Column(type: "size_enum[]", nullable: false, comment: "Размеры родословной"), + hp = table.Column(type: "integer", nullable: false, comment: "Количество очков здоровья"), + speed = table.Column(type: "integer", nullable: false, comment: "Скорость передвижения"), + vision_enum = table.Column(type: "vision_enum", nullable: false, comment: "Тип зрения") }, constraints: table => { @@ -174,7 +174,7 @@ namespace Pf2eModel.Migrations name: "backgrounds", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") }, constraints: table => { @@ -191,12 +191,11 @@ namespace Pf2eModel.Migrations name: "classes", columns: table => new { - id = table.Column(type: "integer", nullable: false), - hp = table.Column(type: "integer", nullable: false), - perception = table.Column(type: "integer", nullable: false), - spellcasting = table.Column(type: "boolean", nullable: false), - tradition = table.Column(type: "spell_tradition", nullable: false), - additional_trained_skills = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + hp = table.Column(type: "integer", nullable: false, comment: "Количество очков здоровья"), + spellcasting = table.Column(type: "boolean", nullable: false, comment: "Заклинатель?"), + tradition = table.Column(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"), + additional_trained_skills = table.Column(type: "integer", nullable: false, comment: "Дополнительные навыки") }, constraints: table => { @@ -213,9 +212,9 @@ namespace Pf2eModel.Migrations name: "conditions", columns: table => new { - id = table.Column(type: "integer", nullable: false), - group = table.Column(type: "condition_group", nullable: true), - extra = table.Column(type: "text", nullable: true) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + group = table.Column(type: "condition_group", nullable: true, comment: "Группа состояния"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") }, constraints: table => { @@ -232,11 +231,11 @@ namespace Pf2eModel.Migrations name: "deities", columns: table => new { - id = table.Column(type: "integer", nullable: false), - category = table.Column(type: "deity_category", nullable: false), - fonts = table.Column(type: "deity_fonts", nullable: false), - sanctification = table.Column(type: "deity_sanctification", nullable: false), - sanctification_must = table.Column(type: "boolean", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + category = table.Column(type: "deity_category", 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: "Обязательное освящение") }, constraints: table => { @@ -253,15 +252,15 @@ namespace Pf2eModel.Migrations name: "feats", columns: table => new { - id = table.Column(type: "integer", nullable: false), - category = table.Column(type: "action_category", nullable: false), - level = table.Column(type: "integer", nullable: false), - actions = table.Column(type: "integer", nullable: true), + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + category = table.Column(type: "feat_category", nullable: false, comment: "Категория способности"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень способности"), + actions = table.Column(type: "integer", nullable: true, comment: "Количество действий"), max_actions = table.Column(type: "integer", nullable: true), is_reaction = table.Column(type: "boolean", nullable: false), is_free_action = table.Column(type: "boolean", nullable: false), is_passive = table.Column(type: "boolean", nullable: false), - extra = table.Column(type: "text", nullable: true) + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") }, constraints: table => { @@ -278,8 +277,7 @@ namespace Pf2eModel.Migrations name: "languages", columns: table => new { - id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), entity_id = table.Column(type: "integer", nullable: false) }, constraints: table => @@ -297,21 +295,21 @@ namespace Pf2eModel.Migrations name: "rituals", columns: table => new { - id = table.Column(type: "integer", nullable: false), - level = table.Column(type: "integer", nullable: false), + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень ритуала"), cast_time = table.Column(type: "integer", nullable: false, comment: "Продолжительность ритуала в секундах"), duration = table.Column(type: "integer", nullable: false, comment: "Время действия эффекта ритуала в секундах"), - elements = table.Column(type: "integer[]", nullable: false), - range = table.Column(type: "integer", nullable: false), - primary_check_rank = table.Column(type: "training_rank", nullable: false), - primary_check_suffix = table.Column(type: "jsonb", nullable: true), - secondary_casters = table.Column(type: "integer", nullable: false), - secondary_casters_max = table.Column(type: "integer", nullable: false), - secondary_casters_suffix = table.Column(type: "jsonb", nullable: true), - range_string = table.Column(type: "jsonb", nullable: true), - target = table.Column(type: "jsonb", nullable: true), - cost = table.Column(type: "jsonb", nullable: true), - requirement = table.Column(type: "jsonb", nullable: true) + elements = table.Column(type: "element_enum[]", nullable: false, comment: "Элементы ритуала"), + range = table.Column(type: "integer", nullable: false, comment: "Дальнность ритуала"), + primary_check_rank = table.Column(type: "training_rank", nullable: false, comment: "Ранг основной проверки"), + primary_check_suffix = table.Column(type: "jsonb", nullable: true, comment: "Дополнительная информация об основной проверки"), + secondary_casters = table.Column(type: "integer", nullable: false, comment: "Количество дополнительных заклинателей"), + secondary_casters_max = table.Column(type: "integer", nullable: false, comment: "Максимальное количество дополнительных заклинателей"), + secondary_casters_suffix = table.Column(type: "jsonb", nullable: true, comment: "Дополнительная информация о дополнительных заклинателях"), + range_string = table.Column(type: "jsonb", nullable: true, comment: "Дальность ритуала"), + target = table.Column(type: "jsonb", nullable: true, comment: "Цель ритуала"), + cost = table.Column(type: "jsonb", nullable: true, comment: "Стоимость ритуала"), + requirement = table.Column(type: "jsonb", nullable: true, comment: "Требования к ритуалу") }, constraints: table => { @@ -328,9 +326,9 @@ namespace Pf2eModel.Migrations name: "rules", columns: table => new { - id = table.Column(type: "integer", nullable: false), - order = table.Column(type: "integer", nullable: false), - parent_id = table.Column(type: "integer", nullable: true), + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + order = table.Column(type: "integer", nullable: false, comment: "Порядок отображения"), + parent_id = table.Column(type: "integer", nullable: true, comment: "Родительского правило"), breadcrumbs = table.Column(type: "text[]", nullable: false) }, constraints: table => @@ -353,18 +351,18 @@ namespace Pf2eModel.Migrations name: "spells", columns: table => new { - id = table.Column(type: "integer", nullable: false), + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), level = table.Column(type: "integer", nullable: false), - is_focus = table.Column(type: "boolean", nullable: false), - actions = table.Column(type: "action_enum", nullable: false), - duration = table.Column(type: "integer", maxLength: 255, nullable: true), - range = table.Column(type: "integer", nullable: false), - traditions = table.Column(type: "spell_tradition[]", nullable: false), - elements = table.Column(type: "integer[]", nullable: false), - trigger = table.Column(type: "jsonb", nullable: true), - target = table.Column(type: "jsonb", nullable: true), - cost = table.Column(type: "jsonb", nullable: true), - requirement = table.Column(type: "jsonb", nullable: true) + is_focus = table.Column(type: "boolean", nullable: false, comment: "Фокус?"), + actions = table.Column(type: "action_enum", nullable: false, comment: "Количество действий"), + duration = table.Column(type: "integer", maxLength: 255, nullable: true, comment: "Время длительности заклинания"), + range = table.Column(type: "integer", nullable: false, comment: "Дальность заклинания"), + traditions = table.Column(type: "spell_tradition[]", nullable: false, comment: "Традиции заклинания"), + elements = table.Column(type: "element_enum[]", nullable: false, comment: "Элементы заклинания"), + trigger = table.Column(type: "jsonb", nullable: true, comment: "Триггер заклинания"), + target = table.Column(type: "jsonb", nullable: true, comment: "Цель заклинания"), + cost = table.Column(type: "jsonb", nullable: true, comment: "Стоимость заклинания"), + requirement = table.Column(type: "jsonb", nullable: true, comment: "Требования к заклинанию") }, constraints: table => { @@ -381,8 +379,8 @@ namespace Pf2eModel.Migrations name: "traits", columns: table => new { - id = table.Column(type: "integer", nullable: false), - type = table.Column(type: "trait_type", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + type = table.Column(type: "trait_type", nullable: false, comment: "Тип признака") }, constraints: table => { @@ -399,10 +397,10 @@ namespace Pf2eModel.Migrations name: "entity_externals", columns: table => new { - entity_id = table.Column(type: "integer", nullable: false), - target_id = table.Column(type: "integer", nullable: false), + entity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор сущности"), + target_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор цели"), suffix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть URL до объекта. Для источников Foundry - полный UUID объекта"), - md5 = table.Column(type: "character varying(32)", maxLength: 32, nullable: false, comment: "Контроль версии объекта") + md5 = table.Column(type: "character varying(32)", maxLength: 32, nullable: false, comment: "Контрольная сумма объекта") }, constraints: table => { @@ -449,10 +447,10 @@ namespace Pf2eModel.Migrations name: "keyword_aliases", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - keyword_id = table.Column(type: "integer", nullable: false), - value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + keyword_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор ключевого слова"), + value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Синоним") }, constraints: table => { @@ -469,10 +467,10 @@ namespace Pf2eModel.Migrations name: "entity_sources", columns: table => new { - id = table.Column(type: "integer", nullable: false) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - entity_id = table.Column(type: "integer", nullable: false), - source_id = table.Column(type: "integer", nullable: false), + entity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор сущности"), + source_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор источника"), suffix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Номер страницы, эррата и т.д."), is_remaster = table.Column(type: "boolean", nullable: false, comment: "Флаг, указывающий, что объект является частью ремастера") }, @@ -543,8 +541,8 @@ namespace Pf2eModel.Migrations name: "heritages", columns: table => new { - id = table.Column(type: "integer", nullable: false), - ancestry_id = table.Column(type: "integer", nullable: true) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + ancestry_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор родословной") }, constraints: table => { @@ -713,8 +711,8 @@ namespace Pf2eModel.Migrations name: "subclass_groups", columns: table => new { - id = table.Column(type: "integer", nullable: false), - class_id = table.Column(type: "integer", nullable: true) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + class_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор класса") }, constraints: table => { @@ -820,10 +818,10 @@ namespace Pf2eModel.Migrations name: "archetypes", columns: table => new { - id = table.Column(type: "integer", nullable: false), - level = table.Column(type: "integer", nullable: false), - dedication_feat_id = table.Column(type: "integer", nullable: true), - extra = table.Column(type: "text", nullable: true) + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень"), + dedication_feat_id = table.Column(type: "integer", nullable: true, comment: "ID посвящения"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") }, constraints: table => { @@ -1059,9 +1057,9 @@ namespace Pf2eModel.Migrations name: "subclasses", columns: table => new { - id = table.Column(type: "integer", nullable: false), - group_id = table.Column(type: "integer", nullable: false), - additional = table.Column(type: "jsonb", nullable: false), + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + group_id = table.Column(type: "integer", nullable: false, comment: "Группа подклассов"), + additional = table.Column(type: "jsonb", nullable: false, comment: "Дополнительная информация"), extra = table.Column(type: "text", nullable: false) }, constraints: table => diff --git a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs index 6e03cb4..1dcf56e 100644 --- a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs +++ b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs @@ -21,28 +21,28 @@ namespace Pf2eModel.Migrations .HasAnnotation("ProductVersion", "9.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "unknown", "archetype", "class-feature", "class-feat", "offensive", "defensive", "interaction", "familiar", "army_tactic", "army_war_action", "kingdom_activity", "kingdom_feat", "kingdom_feature" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_enum", new[] { "unknown", "1", "2", "3", "reaction", "free", "passive", "other", "1-3", "1-2", "2-3", "2/2 rounds", "reaction/1", "reaction/2", "reaction/3", "free/1", "1 minute", "5 minutes", "10 minutes", "30 minutes", "1 hour" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ancestry_vision", new[] { "normal", "low-light-vision", "dark-vision" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "free", "str", "dex", "con", "int", "wis", "cha" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "entity", "ancestry_feat", "class_feat", "general_feat", "skill_feat", "skill_increase" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "unknown", "senses", "abilities", "death", "attitudes", "detection" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_category", new[] { "deity", "pantheon", "covenant", "philosophy" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "none", "heal", "harm", "any" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "holy", "unholy", "any" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "uncommon", "rare", "unique" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "unknown", "trait", "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "subclass_group", "subclass", "condition", "deity", "feat", "heritage", "spell", "ritual", "language", "rule" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_action_type", new[] { "passive", "action", "reaction", "free" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "uncategorized", "ancestry-feature", "class-feature", "calling", "class", "skill", "general", "ancestry", "bonus", "deityboon", "curse", "pfsboon", "campaign-feature" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "legacy_english", "russian", "legacy", "hobby", "other" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size", new[] { "tiny", "small", "medium", "large" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "source_category", new[] { "rulebook", "adventure-path", "lost-omens", "adventures", "comics", "blog-posts", "society" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_area_type", new[] { "burst", "emanation", "cone", "line", "square", "cube", "cylinder", "varies", "cuboid", "circle", "other" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "persistent", "splash" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "damage", "healing", "any" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "none", "divine", "occult", "arcane", "primal", "elemental", "all" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "untrained", "trained", "expert", "master", "legendary", "mythic" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "regular", "class", "tradition" }); + 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_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" }); + 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, "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, "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", "legacy", "legacy_english", "other", "russian" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "source_category", new[] { "adventure-path", "adventures", "blog-posts", "comics", "lost-omens", "rulebook", "society" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_area_type", new[] { "burst", "circle", "cone", "cube", "cuboid", "cylinder", "emanation", "line", "other", "square", "varies" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "normal", "persistent", "splash" }); + 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, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("DeityTraining", b => @@ -117,7 +117,7 @@ namespace Pf2eModel.Migrations .HasColumnType("text") .HasColumnName("description") .HasColumnOrder(6) - .HasComment("Текстовое описание объекта"); + .HasComment("Текстовое описание сущности"); b.Property("Img") .IsRequired() @@ -131,13 +131,13 @@ namespace Pf2eModel.Migrations .HasColumnType("boolean") .HasColumnName("is_checked") .HasColumnOrder(9) - .HasComment("Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи"); + .HasComment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи"); b.Property("IsTranslated") .HasColumnType("boolean") .HasColumnName("is_translated") .HasColumnOrder(8) - .HasComment("Флаг, указывающий, что у объекта существует перевод"); + .HasComment("Флаг, указывающий, что у сущности существует перевод"); b.Property("Name") .IsRequired() @@ -149,7 +149,8 @@ namespace Pf2eModel.Migrations b.Property("Rarity") .HasColumnType("entity_rarity") .HasColumnName("rarity") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Редкость сущности"); b.Property("Slug") .IsRequired() @@ -163,7 +164,7 @@ namespace Pf2eModel.Migrations .HasColumnType("entity_type") .HasColumnName("type") .HasColumnOrder(3) - .HasComment("Тип объекта"); + .HasComment("Тип сущности"); b.HasKey("Id") .HasName("pk_entities"); @@ -185,14 +186,16 @@ namespace Pf2eModel.Migrations .IsRequired() .HasColumnType("jsonb") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); b.Property("Slug") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("slug") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Часть имени в URL"); b.HasKey("Id") .HasName("pk_keywords"); @@ -206,21 +209,24 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("KeywordId") .HasColumnType("integer") .HasColumnName("keyword_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор ключевого слова"); b.Property("Value") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("value") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Синоним"); b.HasKey("Id") .HasName("pk_keyword_aliases"); @@ -237,14 +243,16 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(0); + .HasColumnOrder(0) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("EntityId") .HasColumnType("integer") .HasColumnName("entity_id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); b.Property("IsRemaster") .HasColumnType("boolean") @@ -255,7 +263,8 @@ namespace Pf2eModel.Migrations b.Property("SourceId") .HasColumnType("integer") .HasColumnName("source_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор источника"); b.Property("Suffix") .IsRequired() @@ -283,26 +292,30 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Category") .HasColumnType("source_category") .HasColumnName("category") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Категория источника"); b.Property("Name") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); b.Property("ReleaseDate") .HasColumnType("date") .HasColumnName("release_date") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Дата выхода источника"); b.HasKey("Id") .HasName("pk_sources"); @@ -315,12 +328,14 @@ namespace Pf2eModel.Migrations b.Property("EntityId") .HasColumnType("integer") .HasColumnName("entity_id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); b.Property("TargetId") .HasColumnType("integer") .HasColumnName("target_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор цели"); b.Property("Md5") .IsRequired() @@ -328,7 +343,7 @@ namespace Pf2eModel.Migrations .HasColumnType("character varying(32)") .HasColumnName("md5") .HasColumnOrder(5) - .HasComment("Контроль версии объекта"); + .HasComment("Контрольная сумма объекта"); b.Property("Suffix") .IsRequired() @@ -353,7 +368,8 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); @@ -362,21 +378,24 @@ namespace Pf2eModel.Migrations .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("icon") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Иконка цели"); b.Property("Name") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); b.Property("Prefix") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("prefix") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Префикс для URL-адреса внешней ссылки"); b.HasKey("Id") .HasName("pk_external_targets"); @@ -390,24 +409,28 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Max") .HasColumnType("integer") .HasColumnName("max") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Максимальная продолжительсность"); b.Property("Per") .HasColumnType("integer") .HasColumnName("per") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Частота использования"); b.Property("Value") .HasColumnType("integer") .HasColumnName("value") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Значение использования"); b.HasKey("Id") .HasName("pk_frequencies"); @@ -421,7 +444,8 @@ namespace Pf2eModel.Migrations .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); @@ -429,12 +453,14 @@ namespace Pf2eModel.Migrations .IsRequired() .HasColumnType("jsonb") .HasColumnName("name") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Название способности"); b.Property("Type") .HasColumnType("integer") .HasColumnName("type") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Тип способности"); b.HasKey("Id") .HasName("pk_trainings"); @@ -447,17 +473,20 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Actions") .HasColumnType("action_enum") .HasColumnName("actions") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Количество действий"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); b.HasKey("Id") .HasName("pk_actions"); @@ -470,28 +499,33 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Hp") .HasColumnType("integer") .HasColumnName("hp") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Количество очков здоровья"); - b.PrimitiveCollection("Size") + b.PrimitiveCollection("Size") .IsRequired() - .HasColumnType("size[]") + .HasColumnType("size_enum[]") .HasColumnName("size") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Размеры родословной"); b.Property("Speed") .HasColumnType("integer") .HasColumnName("speed") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Скорость передвижения"); - b.Property("Vision") - .HasColumnType("ancestry_vision") - .HasColumnName("vision") - .HasColumnOrder(5); + b.Property("VisionEnum") + .HasColumnType("vision_enum") + .HasColumnName("vision_enum") + .HasColumnOrder(5) + .HasComment("Тип зрения"); b.HasKey("Id") .HasName("pk_ancestries"); @@ -590,22 +624,26 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("DedicationFeatId") .HasColumnType("integer") .HasColumnName("dedication_feat_id") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("ID посвящения"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Дополнительная информация"); b.Property("Level") .HasColumnType("integer") .HasColumnName("level") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Уровень"); b.HasKey("Id") .HasName("pk_archetypes"); @@ -641,7 +679,8 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.HasKey("Id") .HasName("pk_backgrounds"); @@ -743,32 +782,32 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("AdditionalTrainedSkills") .HasColumnType("integer") .HasColumnName("additional_trained_skills") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Дополнительные навыки"); b.Property("Hp") .HasColumnType("integer") .HasColumnName("hp") - .HasColumnOrder(3); - - b.Property("Perception") - .HasColumnType("integer") - .HasColumnName("perception") - .HasColumnOrder(4); + .HasColumnOrder(2) + .HasComment("Количество очков здоровья"); b.Property("Spellcasting") .HasColumnType("boolean") .HasColumnName("spellcasting") - .HasColumnOrder(5); + .HasColumnOrder(3) + .HasComment("Заклинатель?"); - b.Property("Tradition") + b.Property("Tradition") .HasColumnType("spell_tradition") .HasColumnName("tradition") - .HasColumnOrder(6); + .HasColumnOrder(6) + .HasComment("Традиция заклинаний"); b.HasKey("Id") .HasName("pk_classes"); @@ -945,17 +984,20 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); b.Property("Group") .HasColumnType("condition_group") .HasColumnName("group") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Группа состояния"); b.HasKey("Id") .HasName("pk_conditions"); @@ -968,27 +1010,32 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Category") .HasColumnType("deity_category") .HasColumnName("category") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Тип божества"); b.Property("Fonts") .HasColumnType("deity_fonts") .HasColumnName("fonts") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Тип божественной силы"); b.Property("Sanctification") .HasColumnType("deity_sanctification") .HasColumnName("sanctification") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Тип освящения"); b.Property("SanctificationMust") .HasColumnType("boolean") .HasColumnName("sanctification_must") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Обязательное освящение"); b.HasKey("Id") .HasName("pk_deities"); @@ -1123,22 +1170,26 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Actions") .HasColumnType("integer") .HasColumnName("actions") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Количество действий"); - b.Property("Category") - .HasColumnType("action_category") + b.Property("Category") + .HasColumnType("feat_category") .HasColumnName("category") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Категория способности"); b.Property("Extra") .HasColumnType("text") .HasColumnName("extra") - .HasColumnOrder(10); + .HasColumnOrder(10) + .HasComment("Дополнительная информация"); b.Property("IsFreeAction") .HasColumnType("boolean") @@ -1158,7 +1209,8 @@ namespace Pf2eModel.Migrations b.Property("Level") .HasColumnType("integer") .HasColumnName("level") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Уровень способности"); b.Property("MaxActions") .HasColumnType("integer") @@ -1207,12 +1259,14 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("AncestryId") .HasColumnType("integer") .HasColumnName("ancestry_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор родословной"); b.HasKey("Id") .HasName("pk_heritages"); @@ -1226,12 +1280,10 @@ namespace Pf2eModel.Migrations modelBuilder.Entity("Pf2eModel.Model.Structure.Language", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("EntityId") .HasColumnType("integer") @@ -1251,7 +1303,8 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("CastTime") .HasColumnType("integer") @@ -1262,7 +1315,8 @@ namespace Pf2eModel.Migrations b.Property("Cost") .HasColumnType("jsonb") .HasColumnName("cost") - .HasColumnOrder(14); + .HasColumnOrder(14) + .HasComment("Стоимость ритуала"); b.Property("Duration") .HasColumnType("integer") @@ -1270,61 +1324,72 @@ namespace Pf2eModel.Migrations .HasColumnOrder(4) .HasComment("Время действия эффекта ритуала в секундах"); - b.PrimitiveCollection("Elements") + b.PrimitiveCollection("Elements") .IsRequired() - .HasColumnType("integer[]") + .HasColumnType("element_enum[]") .HasColumnName("elements") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Элементы ритуала"); b.Property("Level") .HasColumnType("integer") .HasColumnName("level") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Уровень ритуала"); b.Property("PrimaryCheckRank") .HasColumnType("training_rank") .HasColumnName("primary_check_rank") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Ранг основной проверки"); b.Property("PrimaryCheckSuffix") .HasColumnType("jsonb") .HasColumnName("primary_check_suffix") - .HasColumnOrder(8); + .HasColumnOrder(8) + .HasComment("Дополнительная информация об основной проверки"); b.Property("Range") .HasColumnType("integer") .HasColumnName("range") - .HasColumnOrder(6); + .HasColumnOrder(6) + .HasComment("Дальнность ритуала"); b.Property("RangeString") .HasColumnType("jsonb") .HasColumnName("range_string") - .HasColumnOrder(12); + .HasColumnOrder(12) + .HasComment("Дальность ритуала"); b.Property("Requirement") .HasColumnType("jsonb") .HasColumnName("requirement") - .HasColumnOrder(15); + .HasColumnOrder(15) + .HasComment("Требования к ритуалу"); b.Property("SecondaryCasters") .HasColumnType("integer") .HasColumnName("secondary_casters") - .HasColumnOrder(9); + .HasColumnOrder(9) + .HasComment("Количество дополнительных заклинателей"); b.Property("SecondaryCastersMax") .HasColumnType("integer") .HasColumnName("secondary_casters_max") - .HasColumnOrder(10); + .HasColumnOrder(10) + .HasComment("Максимальное количество дополнительных заклинателей"); b.Property("SecondaryCastersSuffix") .HasColumnType("jsonb") .HasColumnName("secondary_casters_suffix") - .HasColumnOrder(11); + .HasColumnOrder(11) + .HasComment("Дополнительная информация о дополнительных заклинателях"); b.Property("Target") .HasColumnType("jsonb") .HasColumnName("target") - .HasColumnOrder(13); + .HasColumnOrder(13) + .HasComment("Цель ритуала"); b.HasKey("Id") .HasName("pk_rituals"); @@ -1408,7 +1473,8 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.PrimitiveCollection("Breadcrumbs") .IsRequired() @@ -1418,12 +1484,14 @@ namespace Pf2eModel.Migrations b.Property("Order") .HasColumnType("integer") .HasColumnName("order") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Порядок отображения"); b.Property("ParentId") .HasColumnType("integer") .HasColumnName("parent_id") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Родительского правило"); b.HasKey("Id") .HasName("pk_rules"); @@ -1439,34 +1507,40 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Actions") .HasColumnType("action_enum") .HasColumnName("actions") - .HasColumnOrder(4); + .HasColumnOrder(4) + .HasComment("Количество действий"); b.Property("Cost") .HasColumnType("jsonb") .HasColumnName("cost") - .HasColumnOrder(11); + .HasColumnOrder(11) + .HasComment("Стоимость заклинания"); b.Property("Duration") .HasMaxLength(255) .HasColumnType("integer") .HasColumnName("duration") - .HasColumnOrder(5); + .HasColumnOrder(5) + .HasComment("Время длительности заклинания"); - b.PrimitiveCollection("Elements") + b.PrimitiveCollection("Elements") .IsRequired() - .HasColumnType("integer[]") + .HasColumnType("element_enum[]") .HasColumnName("elements") - .HasColumnOrder(8); + .HasColumnOrder(8) + .HasComment("Элементы заклинания"); b.Property("IsFocus") .HasColumnType("boolean") .HasColumnName("is_focus") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Фокус?"); b.Property("Level") .HasColumnType("integer") @@ -1476,28 +1550,33 @@ namespace Pf2eModel.Migrations b.Property("Range") .HasColumnType("integer") .HasColumnName("range") - .HasColumnOrder(6); + .HasColumnOrder(6) + .HasComment("Дальность заклинания"); b.Property("Requirement") .HasColumnType("jsonb") .HasColumnName("requirement") - .HasColumnOrder(12); + .HasColumnOrder(12) + .HasComment("Требования к заклинанию"); b.Property("Target") .HasColumnType("jsonb") .HasColumnName("target") - .HasColumnOrder(10); + .HasColumnOrder(10) + .HasComment("Цель заклинания"); b.PrimitiveCollection("Traditions") .IsRequired() .HasColumnType("spell_tradition[]") .HasColumnName("traditions") - .HasColumnOrder(7); + .HasColumnOrder(7) + .HasComment("Традиции заклинания"); b.Property("Trigger") .HasColumnType("jsonb") .HasColumnName("trigger") - .HasColumnOrder(9); + .HasColumnOrder(9) + .HasComment("Триггер заклинания"); b.HasKey("Id") .HasName("pk_spells"); @@ -1652,13 +1731,15 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Additional") .IsRequired() .HasColumnType("jsonb") .HasColumnName("additional") - .HasColumnOrder(3); + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); b.Property("Extra") .IsRequired() @@ -1669,7 +1750,8 @@ namespace Pf2eModel.Migrations b.Property("GroupId") .HasColumnType("integer") .HasColumnName("group_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Группа подклассов"); b.HasKey("Id") .HasName("pk_subclasses"); @@ -1685,12 +1767,14 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("ClassId") .HasColumnType("integer") .HasColumnName("class_id") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Идентификатор класса"); b.HasKey("Id") .HasName("pk_subclass_groups"); @@ -1706,12 +1790,14 @@ namespace Pf2eModel.Migrations b.Property("Id") .HasColumnType("integer") .HasColumnName("id") - .HasColumnOrder(1); + .HasColumnOrder(1) + .HasComment("Идентификатор"); b.Property("Type") .HasColumnType("trait_type") .HasColumnName("type") - .HasColumnOrder(2); + .HasColumnOrder(2) + .HasComment("Тип признака"); b.HasKey("Id") .HasName("pk_traits"); diff --git a/Pf2eModel/Model/Base/Entity.cs b/Pf2eModel/Model/Base/Entity.cs index a9d981e..429e1c8 100644 --- a/Pf2eModel/Model/Base/Entity.cs +++ b/Pf2eModel/Model/Base/Entity.cs @@ -10,51 +10,93 @@ using Pf2eModel.Model.Structure; namespace Pf2eModel.Model.Base; +/// +/// Корневая сущность. +/// public class Entity { + /// + /// Идентификатор сущности. + /// [Key] [Column(Order = 1)] public int Id { get; set; } + /// + /// Отображаемое имя сущности. + /// [Column(Order = 2)] [Comment("Отображаемое имя")] public LocaleString Name { get; set; } = []; + /// + /// Тип сущности. + /// [Column(Order = 3)] - [Comment("Тип объекта")] + [Comment("Тип сущности")] public EntityType Type { get; set; } + /// + /// Часть имени в URL. + /// [Column(Order = 4)] [MaxLength(Pf2eDbContext.NameLength)] [Comment("Часть имени в URL")] public string Slug { get; set; } = null!; + /// + /// Изображение сущности. + /// [Column(Order = 5)] [StringLength(255)] [Comment("Изображение объекта")] public string Img { get; set; } = null!; + /// + /// Текстовое описание сущности. + /// [Column(Order = 6)] - [Comment("Текстовое описание объекта")] - // ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength + [Comment("Текстовое описание сущности")] public string Description { get; set; } = null!; + /// + /// Редкость сущности. + /// [Column(Order = 7)] + [Comment("Редкость сущности")] public EntityRarity Rarity { get; set; } = EntityRarity.Common; + /// + /// Флаг, указывающий, что у объекта существует перевод. + /// [Column(Order = 8)] - [Comment("Флаг, указывающий, что у объекта существует перевод")] + [Comment("Флаг, указывающий, что у сущности существует перевод")] public bool? IsTranslated { get; set; } = false; + /// + /// Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи. + /// [Column(Order = 9)] - [Comment("Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи")] + [Comment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи")] public bool? IsChecked { get; set; } = false; - public virtual ICollection Traits { get; set; } = []; + /// + /// Коллекция признаков, связанных с сущностью. + /// + public ICollection Traits { get; set; } = []; - public virtual ICollection Keywords { get; set; } = []; + /// + /// Коллекция ключевых слов, связанных с сущностью. + /// + public ICollection Keywords { get; set; } = []; - public virtual ICollection Sources { get; set; } = []; + /// + /// Коллекция источников, связанных с сущностью. + /// + public ICollection Sources { get; set; } = []; - public virtual ICollection Externals { get; set; } = []; + /// + /// Коллекция внешних ссылок, связанных с сущностью. + /// + public ICollection Externals { get; set; } = []; } diff --git a/Pf2eModel/Model/Base/Keywords/Keyword.cs b/Pf2eModel/Model/Base/Keywords/Keyword.cs index 0edd73e..0eae282 100644 --- a/Pf2eModel/Model/Base/Keywords/Keyword.cs +++ b/Pf2eModel/Model/Base/Keywords/Keyword.cs @@ -1,25 +1,45 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Common.I18n; namespace Pf2eModel.Model.Base.Keywords; +/// +/// Ключевое слово. +/// public class Keyword { + /// + /// Идентификатор. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 1)] public int Id { get; set; } + /// + /// Отображаемое имя ключевого слова. + /// [Column(Order = 2)] + [Comment("Отображаемое имя")] public LocaleString Name = []; + /// + /// Часть имени в URL. + /// [Column(Order = 3)] [MaxLength(Pf2eDbContext.NameLength)] + [Comment("Часть имени в URL")] public string Slug { get; set; } = null!; - [Newtonsoft.Json.JsonIgnore] + /// + /// Коллекция сущностей, которые используют это ключевое слово. + /// public ICollection Entities { get; set; } = []; + /// + /// Коллекция синонимов ключевого слова. + /// public ICollection Aliases { get; set; } = []; } diff --git a/Pf2eModel/Model/Base/Keywords/KeywordAlias.cs b/Pf2eModel/Model/Base/Keywords/KeywordAlias.cs index cd2574c..e8019b6 100644 --- a/Pf2eModel/Model/Base/Keywords/KeywordAlias.cs +++ b/Pf2eModel/Model/Base/Keywords/KeywordAlias.cs @@ -1,22 +1,40 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; namespace Pf2eModel.Model.Base.Keywords; +/// +/// Синоним ключевого слова. +/// public class KeywordAlias { + /// + /// Идентификатор. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + /// Идентификатор связаннного ключевого слова. + /// [Column(Order = 2)] + [Comment("Идентификатор ключевого слова")] public int KeywordId { get; set; } + /// + /// Значение синонима ключевого слова. + /// [Column(Order = 3)] [MaxLength(Pf2eDbContext.NameLength)] + [Comment("Синоним")] public string Value { get; set; } = null!; - [Newtonsoft.Json.JsonIgnore] + /// + /// Ключевое слово, к которому относится синоним. + /// public Keyword Keyword { get; set; } = null!; } diff --git a/Pf2eModel/Model/Base/Source/EntitySource.cs b/Pf2eModel/Model/Base/Source/EntitySource.cs index df3daa5..9be09d7 100644 --- a/Pf2eModel/Model/Base/Source/EntitySource.cs +++ b/Pf2eModel/Model/Base/Source/EntitySource.cs @@ -4,30 +4,56 @@ using Microsoft.EntityFrameworkCore; namespace Pf2eModel.Model.Base.Source; +/// +/// Связь между сущностью и источником. +/// public class EntitySource { + /// + /// Идентификатор связи. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 0)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + /// Идентификатор сущности. + /// [Column(Order = 1)] + [Comment("Идентификатор сущности")] public int EntityId { get; set; } + /// + /// Идентификатор источника. + /// [Column(Order = 2)] + [Comment("Идентификатор источника")] public int SourceId { get; set; } + /// + /// Дополнительная информация о источнике, например, номер страницы, номер тома и т.д. + /// [Column(Order = 3)] [MaxLength(255)] [Comment("Номер страницы, эррата и т.д.")] public string Suffix { get; set; } = null!; + /// + /// Флаг, указывающий, что объект является частью ремастера. + /// [Column(Order = 4)] [Comment("Флаг, указывающий, что объект является частью ремастера")] public bool IsRemaster { get; set; } - [Newtonsoft.Json.JsonIgnore] + /// + /// Сущность, к которой относится источник. + /// public Entity Entity { get; set; } = null!; + /// + /// Источник, к которому относится сущность. + /// public Source Source { get; set; } = null!; } diff --git a/Pf2eModel/Model/Base/Source/Source.cs b/Pf2eModel/Model/Base/Source/Source.cs index e7035d1..7f098f1 100644 --- a/Pf2eModel/Model/Base/Source/Source.cs +++ b/Pf2eModel/Model/Base/Source/Source.cs @@ -1,26 +1,48 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Base.Source; +/// +/// Источник сущности. +/// public class Source { + /// + /// Идентификатор источника. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + /// Отображаемое имя источника. + /// [Column(Order = 2)] [MaxLength(Pf2eDbContext.NameLength)] + [Comment("Отображаемое имя")] public string Name { get; set; } = null!; + /// + /// Категория источника. + /// [Column(Order = 3)] + [Comment("Категория источника")] public SourceCategory Category { get; set; } + /// + /// Дата выхода источника. + /// [Column(Order = 4)] + [Comment("Дата выхода источника")] public DateOnly? ReleaseDate { get; set; } - [Newtonsoft.Json.JsonIgnore] + /// + /// Связанные сущности. + /// public ICollection EntitySources { get; set; } = []; } diff --git a/Pf2eModel/Model/Base/Targets/EntityExternal.cs b/Pf2eModel/Model/Base/Targets/EntityExternal.cs index 0cbdc76..a662e50 100644 --- a/Pf2eModel/Model/Base/Targets/EntityExternal.cs +++ b/Pf2eModel/Model/Base/Targets/EntityExternal.cs @@ -4,13 +4,24 @@ using Microsoft.EntityFrameworkCore; namespace Pf2eModel.Model.Base.Targets; +/// +/// Внешняя ссылка сущности. +/// [PrimaryKey(nameof(EntityId), nameof(TargetId))] public class EntityExternal { + /// + /// Идентификатор сущности. + /// [Column(Order = 1)] + [Comment("Идентификатор сущности")] public int EntityId { get; set; } + /// + /// Идентификатор цели. + /// [Column(Order = 2)] + [Comment("Идентификатор цели")] public int TargetId { get; set; } /* @@ -19,18 +30,30 @@ public class EntityExternal public string ExternalId { get; set; } = ""; */ + /// + /// Конечная часть URL внешней ссылки. + /// Для источников Foundry - полный UUID объекта. + /// [Column(Order = 4)] [MaxLength(255)] [Comment("Часть URL до объекта. Для источников Foundry - полный UUID объекта")] public string Suffix { get; set; } = ""; + /// + /// Контрольная сумма объекта. + /// [Column(Order = 5)] [MaxLength(32)] - [Comment("Контроль версии объекта")] + [Comment("Контрольная сумма объекта")] public string Md5 { get; set; } = null!; - [Newtonsoft.Json.JsonIgnore] - public virtual Entity Entity { get; set; } = null!; + /// + /// Сущность, которая ссылается на внешнюю ссылку. + /// + public Entity Entity { get; set; } = null!; - public virtual ExternalTarget Target { get; set; } = null!; + /// + /// Цель внешней ссылки. + /// + public ExternalTarget Target { get; set; } = null!; } diff --git a/Pf2eModel/Model/Base/Targets/ExternalTarget.cs b/Pf2eModel/Model/Base/Targets/ExternalTarget.cs index 9fb6db2..44b74bb 100644 --- a/Pf2eModel/Model/Base/Targets/ExternalTarget.cs +++ b/Pf2eModel/Model/Base/Targets/ExternalTarget.cs @@ -1,28 +1,49 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; namespace Pf2eModel.Model.Base.Targets; +/// +/// Цель внешней ссылки. +/// public class ExternalTarget { + /// + /// Идентификатор цели. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + /// Название цели. + /// [Column(Order = 2)] [StringLength(Pf2eDbContext.NameLength)] + [Comment("Отображаемое имя")] public string Name { get; set; } = null!; + /// + /// Иконка цели. + /// [Column(Order = 3)] [StringLength(255)] + [Comment("Иконка цели")] public string Icon { get; set; } = null!; + /// + /// Префикс для URL-адреса внешней ссылки. + /// [Column(Order = 3)] [StringLength(Pf2eDbContext.NameLength)] + [Comment("Префикс для URL-адреса внешней ссылки")] public string Prefix { get; set; } = null!; - [Column(Order = 4)] - [Newtonsoft.Json.JsonIgnore] + /// + /// Коллекция сущностей, которые ссылаются на эту цель. + /// public ICollection EntityExternals { get; set; } = []; } diff --git a/Pf2eModel/Model/Common/Frequency.cs b/Pf2eModel/Model/Common/Frequency.cs index 82ecb97..618d8a8 100644 --- a/Pf2eModel/Model/Common/Frequency.cs +++ b/Pf2eModel/Model/Common/Frequency.cs @@ -1,21 +1,41 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; namespace Pf2eModel.Model.Common; +/// +/// Частота использования. +/// public class Frequency { + /// + /// Идентификатор. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + /// Максимальная продолжительсность. + /// [Column(Order = 2)] + [Comment("Максимальная продолжительсность")] public int Max { get; set; } + /// + /// Частота использования. + /// [Column(Order = 3)] + [Comment("Частота использования")] public int Per { get; set; } + /// + /// Значение использования. + /// [Column(Order = 4)] + [Comment("Значение использования")] public int? Value { get; set; } } diff --git a/Pf2eModel/Model/Common/I18n/LocaleExtension.cs b/Pf2eModel/Model/Common/I18n/LocaleExtension.cs index ee4d8b5..82683bf 100644 --- a/Pf2eModel/Model/Common/I18n/LocaleExtension.cs +++ b/Pf2eModel/Model/Common/I18n/LocaleExtension.cs @@ -3,8 +3,16 @@ using System.Reflection; namespace Pf2eModel.Model.Common.I18n; +/// +/// Расширения для работы с локализацией. +/// public static class LocaleExtension { + /// + /// Получение строкового представления типа локализации. + /// + /// Тип локализации. + /// Строковое представление типа локализации. public static string GetTypeString(this LocaleType localeType) { FieldInfo fi = localeType.GetType().GetField(localeType.ToString())!; @@ -16,7 +24,13 @@ public static class LocaleExtension ?? localeType.ToString(); } - public static LocaleType GetTypeByString(this string localeType) + /// + /// Получение типа локализации по строковому представлению типа локализации. + /// + /// Строковое представление типа локализации. + /// Тип локализации. + /// Исключение, если строковое представление не соответсвует ни одному типу локализации. + public static LocaleType GetTypeByString(this string localeTypeString) { foreach (FieldInfo field in typeof(LocaleType).GetFields()) { @@ -28,7 +42,7 @@ public static class LocaleExtension continue; } - if (descriptionAttribute.Description == localeType) + if (descriptionAttribute.Description == localeTypeString) { return (LocaleType)field.GetValue(null)!; } @@ -36,6 +50,7 @@ public static class LocaleExtension throw new InvalidEnumArgumentException(); } + /* public static IQueryable WhereLocale( this IQueryable query, Expression> expression, string searchTerm) where T : class diff --git a/Pf2eModel/Model/Common/I18n/LocaleItem.cs b/Pf2eModel/Model/Common/I18n/LocaleItem.cs index 62fd22a..f1b232c 100644 --- a/Pf2eModel/Model/Common/I18n/LocaleItem.cs +++ b/Pf2eModel/Model/Common/I18n/LocaleItem.cs @@ -1,11 +1,26 @@ namespace Pf2eModel.Model.Common.I18n; +/// +/// Элемент локализации. +/// +/// Тип локализации. +/// Значение локализации. public class LocaleItem(LocaleType type, string value) { + /// + /// Тип локализации. + /// public LocaleType Locale { get; set; } = type; + /// + /// Значение локализации. + /// public string Value { get; set; } = value; + /// + /// Конструктор класса по паре ключ-значение. + /// + /// Пара ключ-значение по строковому представлению типа. public LocaleItem(KeyValuePair item) - : this(LocaleExtension.GetTypeByString(item.Key), item.Value) { } + : this(item.Key.GetTypeByString(), item.Value) { } } diff --git a/Pf2eModel/Model/Common/I18n/LocaleString.cs b/Pf2eModel/Model/Common/I18n/LocaleString.cs index 5db8d95..f4482fe 100644 --- a/Pf2eModel/Model/Common/I18n/LocaleString.cs +++ b/Pf2eModel/Model/Common/I18n/LocaleString.cs @@ -3,40 +3,90 @@ using Newtonsoft.Json.Linq; namespace Pf2eModel.Model.Common.I18n; +/// +/// Локализованная строка. +/// public class LocaleString : ICollection { + /// + /// Список локализаций строк. + /// private readonly List _items = []; + /// + /// Проверяет наличие хотя бы одной локализации. + /// private void AssureDefault() { if (_items.Count == 0) { - _items.Add(new LocaleItem(LocaleType.English, string.Empty)); + _items.Add(new(LocaleType.English, string.Empty)); } } + /// + /// Количество локализаций. + /// public int Count => _items.Count; - public bool IsReadOnly => false; - + /// + /// Коллекция реализованных типов локализаций. + /// public ICollection Types => _items.Select(c => c.Locale).ToList(); + /// + public bool IsReadOnly => false; + + /// + /// Конструктор класса . + /// public LocaleString() { AssureDefault(); } - private LocaleType _E(string localeString) => LocaleExtension.GetTypeByString(localeString); + /// + /// Получение типа локализации по строковому представлению. + /// + /// Строковое представление. + /// Тип локализации. + private LocaleType _E(string localeString) => localeString.GetTypeByString(); + /// + /// Получение типа локализации с учётом её наличия в коллекции. + /// + /// Искомый тип локализации. + /// Реальный тип локализации. private LocaleType RealLocale(LocaleType locale) => Contains(locale) ? locale : LocaleType.English; + /// + /// Получение типа локализации по строковому представлению с учётом её наличия в коллекции. + /// + /// Строковое представление искомого типа локализации. + /// Реальный тип локализации. private LocaleType RealLocale(string localeString) => RealLocale(_E(localeString)); + /// + /// Получение объекта локализованной строки по типу локализации. + /// + /// Искомый тип локализации. + /// Объект локализованной строки. public LocaleItem GetItem(LocaleType locale) => this.First(c => c.Locale == RealLocale(locale)); - public LocaleItem GetItem(string locale) => this.First(c => c.Locale == RealLocale(locale)); + /// + /// Получение объекта локализованной строки по строковому представлению типа локализации. + /// + /// Строковое представление искомого типа локализации. + /// Объект локализованной строки. + public LocaleItem GetItem(string localeString) => + this.First(c => c.Locale == RealLocale(localeString)); + /// + /// Получение локализованной строки по типу локализации. + /// + /// Искомый тип локализации. + /// Локализованная строка. public string this[LocaleType locale] { get => GetItem(locale).Value; @@ -48,52 +98,87 @@ public class LocaleString : ICollection } else { - _items.Add(new LocaleItem(locale, value)); + _items.Add(new(locale, value)); } } } + + /// + /// Получение локализованной строки по типу локализации. + /// + /// Строковое представление искомого типа локализации. + /// Локализованная строка. public string this[string localeString] { get => this[_E(localeString)]; set => this[_E(localeString)] = value; } + /// + /// Добавление объекта локализованной строки в коллекцию. + /// + /// Объект локализированной строки. public void Add(LocaleItem item) { this[item.Locale] = item.Value; } + /// + /// Добавление локализованной строки в коллекцию. + /// + /// Тип локализации. + /// Строка локазации. public void Add(LocaleType locale, string value) { this[locale] = value; } + /// + /// Отчистка коллекции локализованных строк. + /// public void Clear() { _items.Clear(); AssureDefault(); } + /// + /// Проверка наличия объекта локализованной строки в коллекции. + /// + /// Объект локализированной строки. + /// `true`, если объект есть; `false`, если нет. public bool Contains(LocaleItem item) { return _items.Contains(item); } + /// + /// Проверка наличия локализованной строки в коллекции по типу локализации. + /// + /// Тип локализации. + /// `true`, если искомый тип локализации есть; `false`, если нет. public bool Contains(LocaleType locale) { return Types.Contains(locale); } - public bool Contains(string value) + /// + /// Проверка наличия локализованной строки в коллекции по строковому представлению типа локализации. + /// + /// Строковое представление искомого типа локализации. + /// `true`, если искомый тип локализации есть; `false`, если нет. + public bool Contains(string localeString) { - return this.Any(item => item.Value == value); + return this.Any(item => item.Value == localeString); } + /// public void CopyTo(LocaleItem[] array, int arrayIndex) { throw new NotImplementedException(); } + /// public bool Remove(LocaleItem item) { bool result = _items.Remove(item); @@ -107,21 +192,28 @@ public class LocaleString : ICollection return result; } + /// public IEnumerator GetEnumerator() { return _items.GetEnumerator(); } + /// IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } + /// public override string ToString() { return this[LocaleType.English]; } + /// + /// Сериализация локализованной строки в JSON-формат. + /// + /// Строковое представление JSON-представления. public string Serialize() { JObject json = []; @@ -134,10 +226,15 @@ public class LocaleString : ICollection return json.ToString(); } + /// + /// Десериализация локализованной строки из JSON-формата. + /// + /// Строковое представление JSON-представления. + /// Объект локализованной строки. public static LocaleString Deserialize(string input) { JObject json = JObject.Parse(input); - LocaleString result = new(); + LocaleString result = []; foreach (KeyValuePair item in json) { diff --git a/Pf2eModel/Model/Common/I18n/LocaleType.cs b/Pf2eModel/Model/Common/I18n/LocaleType.cs index 5621b4b..eef6702 100644 --- a/Pf2eModel/Model/Common/I18n/LocaleType.cs +++ b/Pf2eModel/Model/Common/I18n/LocaleType.cs @@ -2,6 +2,9 @@ namespace Pf2eModel.Model.Common.I18n; +/// +/// Тип локализации. +/// public enum LocaleType { [Description("en")] diff --git a/Pf2eModel/Model/Common/Training.cs b/Pf2eModel/Model/Common/Training.cs index f9244e6..3a9023c 100644 --- a/Pf2eModel/Model/Common/Training.cs +++ b/Pf2eModel/Model/Common/Training.cs @@ -1,20 +1,36 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Common; +/// +/// Изучаемая способность. +/// public class Training { + /// + /// Идентификатор. + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + /// Название способности. + /// [Column(Order = 2)] + [Comment("Название способности")] public LocaleString Name { get; set; } = []; + /// + /// Тип способности. + /// [Column(Order = 3)] + [Comment("Тип способности")] public TrainingType Type { get; set; } } diff --git a/Pf2eModel/Model/Enum/ActionCategory.cs b/Pf2eModel/Model/Enum/ActionCategory.cs index c2546f6..14a0adf 100644 --- a/Pf2eModel/Model/Enum/ActionCategory.cs +++ b/Pf2eModel/Model/Enum/ActionCategory.cs @@ -2,10 +2,20 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип действия. +/// public enum ActionCategory { + /// + /// Неизвестный тип действия. + /// + [PgName("unknown")] Unknown, + /// + /// Действие архетипа. + /// [PgName("archetype")] Archetype, diff --git a/Pf2eModel/Model/Enum/ActionEnum.cs b/Pf2eModel/Model/Enum/ActionEnum.cs index ca54d62..7efeb59 100644 --- a/Pf2eModel/Model/Enum/ActionEnum.cs +++ b/Pf2eModel/Model/Enum/ActionEnum.cs @@ -2,6 +2,9 @@ namespace Pf2eModel.Model.Enum; +/// +/// Перечиленение количества действий. +/// public enum ActionEnum { [PgName("unknown")] diff --git a/Pf2eModel/Model/Enum/AncestryVision.cs b/Pf2eModel/Model/Enum/AncestryVision.cs deleted file mode 100644 index dee7ab4..0000000 --- a/Pf2eModel/Model/Enum/AncestryVision.cs +++ /dev/null @@ -1,15 +0,0 @@ -using NpgsqlTypes; - -namespace Pf2eModel.Model.Enum; - -public enum AncestryVision -{ - [PgName("normal")] - Normal, - - [PgName("low-light-vision")] - LowLightVision, - - [PgName("dark-vision")] - DarkVision, -} diff --git a/Pf2eModel/Model/Enum/AttributeValues.cs b/Pf2eModel/Model/Enum/AttributeValues.cs index 955abc7..ca76fbf 100644 --- a/Pf2eModel/Model/Enum/AttributeValues.cs +++ b/Pf2eModel/Model/Enum/AttributeValues.cs @@ -2,26 +2,50 @@ namespace Pf2eModel.Model.Enum; +/// +/// Перечисление значений атрибутов. +/// public enum AttributeValues { + /// + /// Свободный атрибут. + /// [PgName("free")] Free, + /// + /// Сила. + /// [PgName("str")] Strength, + /// + /// Ловкость. + /// [PgName("dex")] Dexterity, + /// + /// Телосложение. + /// [PgName("con")] Constitution, + /// + /// Интеллект. + /// [PgName("int")] Intelligence, + /// + /// Мудрость. + /// [PgName("wis")] Wisdom, + /// + /// Харизма. + /// [PgName("cha")] Charisma, } diff --git a/Pf2eModel/Model/Enum/ClassProgressionType.cs b/Pf2eModel/Model/Enum/ClassProgressionType.cs index 23b6a5b..792637a 100644 --- a/Pf2eModel/Model/Enum/ClassProgressionType.cs +++ b/Pf2eModel/Model/Enum/ClassProgressionType.cs @@ -2,23 +2,50 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип элемента прогрессии класса. +/// public enum ClassProgressionType { + /// + /// Неизвестный тип прогрессии класса. + /// [PgName("entity")] Entity, + /// + /// Навык архетипа. + /// [PgName("ancestry_feat")] AncestryFeat, + /// + /// Классовая особенность. + /// [PgName("class_feat")] ClassFeat, + /// + /// Общий навык. + /// [PgName("general_feat")] GeneralFeat, + /// + /// Навык + /// [PgName("skill_feat")] SkillFeat, + /// + /// Увеличение навыка. + /// [PgName("skill_increase")] SkillIncrease, + + /// + /// Увеличение атрибута. + /// + [PgName("attribute_increase")] + AttributeIncrease, } diff --git a/Pf2eModel/Model/Enum/ConditionGroup.cs b/Pf2eModel/Model/Enum/ConditionGroup.cs index f9cdf1a..3beb2e8 100644 --- a/Pf2eModel/Model/Enum/ConditionGroup.cs +++ b/Pf2eModel/Model/Enum/ConditionGroup.cs @@ -2,23 +2,44 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип состояния +/// public enum ConditionGroup { + /// + /// Неизвестое состояние. + /// [PgName("unknown")] Unknown, + /// + /// Чувство. + /// [PgName("senses")] Senses, + /// + /// Способность. + /// [PgName("abilities")] Abilities, + /// + /// Смерть. + /// [PgName("death")] Death, + /// + /// Отношение. (???) + /// [PgName("attitudes")] Attitudes, + /// + /// Обнаружение. + /// [PgName("detection")] Detection, } diff --git a/Pf2eModel/Model/Enum/DeityCategory.cs b/Pf2eModel/Model/Enum/DeityCategory.cs index a94887a..995d56a 100644 --- a/Pf2eModel/Model/Enum/DeityCategory.cs +++ b/Pf2eModel/Model/Enum/DeityCategory.cs @@ -2,17 +2,32 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип божества. +/// public enum DeityCategory { + /// + /// Божество. + /// [PgName("deity")] Deity, + /// + /// Пантеон. + /// [PgName("pantheon")] Pantheon, + /// + /// Ковенант. + /// [PgName("covenant")] Covenant, + /// + /// Философия. + /// [PgName("philosophy")] Philosophy, } diff --git a/Pf2eModel/Model/Enum/DeityFonts.cs b/Pf2eModel/Model/Enum/DeityFonts.cs index 09cf5d8..0c6331e 100644 --- a/Pf2eModel/Model/Enum/DeityFonts.cs +++ b/Pf2eModel/Model/Enum/DeityFonts.cs @@ -2,17 +2,32 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип божественной силы. +/// public enum DeityFonts { + /// + /// Без божественной силы. + /// [PgName("none")] None, + /// + /// Исцеление. + /// [PgName("heal")] Heal, + /// + /// Урон. + /// [PgName("harm")] Harm, + /// + /// Любой тип божественной силы. + /// [PgName("any")] Any, } diff --git a/Pf2eModel/Model/Enum/DeitySanctification.cs b/Pf2eModel/Model/Enum/DeitySanctification.cs index bda639d..5406f5a 100644 --- a/Pf2eModel/Model/Enum/DeitySanctification.cs +++ b/Pf2eModel/Model/Enum/DeitySanctification.cs @@ -2,14 +2,26 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип освящения божества. +/// public enum DeitySanctification { + /// + /// Святость. + /// [PgName("holy")] Holy, + /// + /// Нечестивость. + /// [PgName("unholy")] Unholy, + /// + /// Любое. + /// [PgName("any")] Any, } diff --git a/Pf2eModel/Model/Enum/ElementEnum.cs b/Pf2eModel/Model/Enum/ElementEnum.cs index c512355..8362a14 100644 --- a/Pf2eModel/Model/Enum/ElementEnum.cs +++ b/Pf2eModel/Model/Enum/ElementEnum.cs @@ -2,26 +2,50 @@ namespace Pf2eModel.Model.Enum; +/// +/// Перечисление элементов. +/// public enum ElementEnum { + /// + /// Универсальный элемент. + /// [PgName("universal")] Universal, + /// + /// Воздух. + /// [PgName("air")] Air, + /// + /// Вода. + /// [PgName("water")] Water, + /// + /// Земля. + /// [PgName("earth")] Earth, + /// + /// Огонь. + /// [PgName("fire")] Fire, + /// + /// Дерево. + /// [PgName("wood")] Wood, + /// + /// Металл. + /// [PgName("metal")] Metal, } diff --git a/Pf2eModel/Model/Enum/EntityRarity.cs b/Pf2eModel/Model/Enum/EntityRarity.cs index c23958e..8c7eca1 100644 --- a/Pf2eModel/Model/Enum/EntityRarity.cs +++ b/Pf2eModel/Model/Enum/EntityRarity.cs @@ -2,17 +2,32 @@ namespace Pf2eModel.Model.Enum; +/// +/// Перечисление редкости сущности. +/// public enum EntityRarity { + /// + /// Обычная редкость. + /// [PgName("common")] Common, + /// + /// Необычная редкость. + /// [PgName("uncommon")] Uncommon, + /// + /// Редкая редкость. + /// [PgName("rare")] Rare, + /// + /// Уникальная редкость. + /// [PgName("unique")] Unique, } diff --git a/Pf2eModel/Model/Enum/EntityType.cs b/Pf2eModel/Model/Enum/EntityType.cs index 83cf742..b3aa3d5 100644 --- a/Pf2eModel/Model/Enum/EntityType.cs +++ b/Pf2eModel/Model/Enum/EntityType.cs @@ -2,62 +2,122 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип сущности. +/// public enum EntityType { + /// + /// Неизвестный тип сущности. + /// [PgName("unknown")] Unknown, + /// + /// Признак. + /// [PgName("trait")] Trait, + /// + /// Действие. + /// [PgName("action")] Action, + /// + /// Родословная. + /// [PgName("ancestry")] Ancestry, + /// + /// Архетип. + /// [PgName("archetype")] Archetype, + /// + /// Происхождение. + /// [PgName("background")] Background, + /// + /// Рюкзак. + /// [PgName("backpack")] Backpack, + /// + /// Способность кампании. + /// [PgName("campaign_feature")] CampaignFeature, + /// + /// Класс. + /// [PgName("class")] Class, + /// + /// Группа подклассов. + /// [PgName("subclass_group")] SubclassGroup, + /// + /// Подкласс. + /// [PgName("subclass")] Subclass, + /// + /// Состояние. + /// [PgName("condition")] Condition, + /// + /// Божество. + /// [PgName("deity")] Deity, + /// + /// Навык. + /// [PgName("feat")] Feat, + /// + /// Наследие. + /// [PgName("heritage")] Heritage, + /// + /// Заклианиние. + /// [PgName("spell")] Spell, + /// + /// Ритуал. + /// [PgName("ritual")] Ritual, + /// + /// Язык. + /// [PgName("language")] Language, + /// + /// Правило. + /// [PgName("rule")] Rule, } diff --git a/Pf2eModel/Model/Enum/FeatActionType.cs b/Pf2eModel/Model/Enum/FeatActionType.cs deleted file mode 100644 index e5b84b0..0000000 --- a/Pf2eModel/Model/Enum/FeatActionType.cs +++ /dev/null @@ -1,18 +0,0 @@ -using NpgsqlTypes; - -namespace Pf2eModel.Model.Enum; - -public enum FeatActionType -{ - [PgName("passive")] - Passive, - - [PgName("action")] - Action, - - [PgName("reaction")] - Reaction, - - [PgName("free")] - Free, -} diff --git a/Pf2eModel/Model/Enum/FeatCategory.cs b/Pf2eModel/Model/Enum/FeatCategory.cs index aa9b183..c85ba49 100644 --- a/Pf2eModel/Model/Enum/FeatCategory.cs +++ b/Pf2eModel/Model/Enum/FeatCategory.cs @@ -7,11 +7,14 @@ public enum FeatCategory [PgName("uncategorized")] Uncategorized, + [PgName("ancestry")] + Ancestry, + [PgName("ancestry-feature")] AncestryFeature, - [PgName("class-feature")] - ClassFeature, + [PgName("archetype")] + Archetype, [PgName("calling")] Calling, @@ -19,15 +22,15 @@ public enum FeatCategory [PgName("class")] Class, + [PgName("class-feature")] + ClassFeature, + [PgName("skill")] Skill, [PgName("general")] General, - [PgName("ancestry")] - Ancestry, - [PgName("bonus")] Bonus, diff --git a/Pf2eModel/Model/Enum/Size.cs b/Pf2eModel/Model/Enum/Size.cs deleted file mode 100644 index 0fc40fc..0000000 --- a/Pf2eModel/Model/Enum/Size.cs +++ /dev/null @@ -1,18 +0,0 @@ -using NpgsqlTypes; - -namespace Pf2eModel.Model.Enum; - -public enum Size -{ - [PgName("tiny")] - Tiny, - - [PgName("small")] - Small, - - [PgName("medium")] - Medium, - - [PgName("large")] - Large, -} diff --git a/Pf2eModel/Model/Enum/SizeEnum.cs b/Pf2eModel/Model/Enum/SizeEnum.cs new file mode 100644 index 0000000..6d65b13 --- /dev/null +++ b/Pf2eModel/Model/Enum/SizeEnum.cs @@ -0,0 +1,39 @@ +using NpgsqlTypes; + +namespace Pf2eModel.Model.Enum; + +/// +/// Размер. +/// +public enum SizeEnum +{ + /// + /// Крошечный размер. + /// + [PgName("tiny")] + Tiny, + + /// + /// Маленький размер. + /// + [PgName("small")] + Small, + + /// + /// Средний размер. + /// + [PgName("medium")] + Medium, + + /// + /// Большой размер. + /// + [PgName("large")] + Large, + + /// + /// Громадный размер. + /// + [PgName("huge")] + Huge, +} diff --git a/Pf2eModel/Model/Enum/SourceCategory.cs b/Pf2eModel/Model/Enum/SourceCategory.cs index c4d140f..c482190 100644 --- a/Pf2eModel/Model/Enum/SourceCategory.cs +++ b/Pf2eModel/Model/Enum/SourceCategory.cs @@ -2,26 +2,50 @@ namespace Pf2eModel.Model.Enum; +/// +/// Перечисление категорий источников. +/// public enum SourceCategory { + /// + /// Неизвестная категория источника. + /// [PgName("rulebook")] Rulebooks, + /// + /// Серия приключений. + /// [PgName("adventure-path")] AdventurePaths, + /// + /// Lost Omens + /// [PgName("lost-omens")] LostOmens, + /// + /// Приключение. + /// [PgName("adventures")] Adventures, + /// + /// Комиксы. + /// [PgName("comics")] Comics, + /// + /// Блог-посты. + /// [PgName("blog-posts")] BlogPosts, + /// + /// Сообщество. + /// [PgName("society")] Society, } diff --git a/Pf2eModel/Model/Enum/SpellAreaType.cs b/Pf2eModel/Model/Enum/SpellAreaType.cs index b0c266b..462b9a0 100644 --- a/Pf2eModel/Model/Enum/SpellAreaType.cs +++ b/Pf2eModel/Model/Enum/SpellAreaType.cs @@ -2,38 +2,74 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип области заклинания. +/// public enum SpellAreaType { + /// + /// Взрыв. + /// [PgName("burst")] Burst, + /// + /// Эманация. + /// [PgName("emanation")] Emanation, + /// + /// Конус. + /// [PgName("cone")] Cone, + /// + /// Линия. + /// [PgName("line")] Line, + /// + /// Квадрат. + /// [PgName("square")] Square, + /// + /// Куб. + /// [PgName("cube")] Cube, + /// + /// Цилиндр. + /// [PgName("cylinder")] Cylinder, + /// + /// Варьируемое. + /// [PgName("varies")] Varies, + /// + /// Параллелипипед. + /// [PgName("cuboid")] Cuboid, + /// + /// Круг. + /// [PgName("circle")] Circle, + /// + /// Иное. + /// [PgName("other")] Other, } diff --git a/Pf2eModel/Model/Enum/SpellDamageCategory.cs b/Pf2eModel/Model/Enum/SpellDamageCategory.cs index 24e9775..0c4caad 100644 --- a/Pf2eModel/Model/Enum/SpellDamageCategory.cs +++ b/Pf2eModel/Model/Enum/SpellDamageCategory.cs @@ -2,11 +2,26 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип урона заклинания. +/// public enum SpellDamageCategory { + /// + /// Обычный урон. + /// + [PgName("normal")] + Normal, + + /// + /// Продолжительный урон. + /// [PgName("persistent")] Persistent, + /// + /// Брызги. + /// [PgName("splash")] Splash, } diff --git a/Pf2eModel/Model/Enum/SpellDamageKinds.cs b/Pf2eModel/Model/Enum/SpellDamageKinds.cs index b2ab3d5..b5f06f4 100644 --- a/Pf2eModel/Model/Enum/SpellDamageKinds.cs +++ b/Pf2eModel/Model/Enum/SpellDamageKinds.cs @@ -2,14 +2,26 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип урона заклинания. +/// public enum SpellDamageKinds { + /// + /// Урон. + /// [PgName("damage")] Damage, + /// + /// Исцеление. + /// [PgName("healing")] Healing, + /// + /// Любое. + /// [PgName("any")] Any, } diff --git a/Pf2eModel/Model/Enum/SpellTradition.cs b/Pf2eModel/Model/Enum/SpellTradition.cs index a5ff392..33a1865 100644 --- a/Pf2eModel/Model/Enum/SpellTradition.cs +++ b/Pf2eModel/Model/Enum/SpellTradition.cs @@ -2,26 +2,50 @@ namespace Pf2eModel.Model.Enum; +/// +/// Традиция заклинания. +/// public enum SpellTradition { + /// + /// Без традиции. + /// [PgName("none")] None, + /// + /// Сакральная традиция. + /// [PgName("divine")] Divine, + /// + /// Оккультная традиция. + /// [PgName("occult")] Occult, + /// + /// Арканная традиция. + /// [PgName("arcane")] Arcane, + /// + /// Примальная традиция. + /// [PgName("primal")] Primal, + /// + /// Элементная традиция. + /// [PgName("elemental")] Elemental, + /// + /// Все традиции. + /// [PgName("all")] All, } diff --git a/Pf2eModel/Model/Enum/TrainingRank.cs b/Pf2eModel/Model/Enum/TrainingRank.cs index 7fae960..d3d93c5 100644 --- a/Pf2eModel/Model/Enum/TrainingRank.cs +++ b/Pf2eModel/Model/Enum/TrainingRank.cs @@ -2,23 +2,44 @@ namespace Pf2eModel.Model.Enum; +/// +/// Ранг тренировки. +/// public enum TrainingRank { + /// + /// Необученный. + /// [PgName("untrained")] Untrained, + /// + /// Обученный. + /// [PgName("trained")] Trained, + /// + /// Эксперт. + /// [PgName("expert")] Expert, + /// + /// Мастер. + /// [PgName("master")] Master, + /// + /// Легендарный. + /// [PgName("legendary")] Legendary, + /// + /// Мифический. + /// [PgName("mythic")] Mythic, } diff --git a/Pf2eModel/Model/Enum/TrainingType.cs b/Pf2eModel/Model/Enum/TrainingType.cs index 3e715e8..774d1f1 100644 --- a/Pf2eModel/Model/Enum/TrainingType.cs +++ b/Pf2eModel/Model/Enum/TrainingType.cs @@ -2,23 +2,44 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип тренировки. +/// public enum TrainingType { + /// + /// Восприятие. + /// [PgName("perception")] Perception, + /// + /// Навык. + /// [PgName("skill")] Skill, + /// + /// Знание. + /// [PgName("lore")] Lore, + /// + /// Оружие. + /// [PgName("weapon")] Weapon, + /// + /// Защита. + /// [PgName("armor")] Armor, + /// + /// Спасбросок. + /// [PgName("save")] Save, } diff --git a/Pf2eModel/Model/Enum/TraitType.cs b/Pf2eModel/Model/Enum/TraitType.cs index b75f9d7..379ec1f 100644 --- a/Pf2eModel/Model/Enum/TraitType.cs +++ b/Pf2eModel/Model/Enum/TraitType.cs @@ -2,14 +2,26 @@ namespace Pf2eModel.Model.Enum; +/// +/// Тип признака. +/// public enum TraitType { + /// + /// Обычный признак. + /// [PgName("regular")] Regular, + /// + /// Признак класса. + /// [PgName("class")] Class, + /// + /// Признак традиции. + /// [PgName("tradition")] Tradition, } diff --git a/Pf2eModel/Model/Enum/VisionEnum.cs b/Pf2eModel/Model/Enum/VisionEnum.cs new file mode 100644 index 0000000..6cd18b0 --- /dev/null +++ b/Pf2eModel/Model/Enum/VisionEnum.cs @@ -0,0 +1,27 @@ +using NpgsqlTypes; + +namespace Pf2eModel.Model.Enum; + +/// +/// Перечисление типов зрения. +/// +public enum VisionEnum +{ + /// + /// Обычное зрение. + /// + [PgName("normal")] + Normal, + + /// + /// Зрение в темноте. + /// + [PgName("low-light-vision")] + LowLightVision, + + /// + /// Тёмное зрение. + /// + [PgName("dark-vision")] + DarkVision, +} diff --git a/Pf2eModel/Model/IEntity.cs b/Pf2eModel/Model/IEntity.cs index 3b36e6d..4b99188 100644 --- a/Pf2eModel/Model/IEntity.cs +++ b/Pf2eModel/Model/IEntity.cs @@ -3,10 +3,19 @@ using Pf2eModel.Model.Base; namespace Pf2eModel.Model; +/// +/// Интерфейс сущностей структуры. +/// public interface IEntity { + /// + /// Идентификатор сущности. + /// public int Id { get; set; } + /// + /// Корневая сущность. + /// [JsonIgnore] public Entity Entity { get; set; } } diff --git a/Pf2eModel/Model/Structure/Action.cs b/Pf2eModel/Model/Structure/Action.cs index 1da0baf..81052d4 100644 --- a/Pf2eModel/Model/Structure/Action.cs +++ b/Pf2eModel/Model/Structure/Action.cs @@ -1,23 +1,38 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Действие. +/// [EntityOfType(EntityType.Action)] public class Action : IEntity { - [System.ComponentModel.DataAnnotations.Key] + /// + [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// + public Entity Entity { get; set; } = null!; + + /// + /// Количество действий. + /// [Column(Order = 2)] + [Comment("Количество действий")] public ActionEnum Actions { get; set; } = ActionEnum.Unknown; + /// + /// Дополнительная информация. + /// [Column(Order = 3)] - // ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength + [Comment("Дополнительная информация")] public string? Extra { get; set; } - - public Entity Entity { get; set; } = null!; } diff --git a/Pf2eModel/Model/Structure/Ancestry.cs b/Pf2eModel/Model/Structure/Ancestry.cs index f26f398..3220424 100644 --- a/Pf2eModel/Model/Structure/Ancestry.cs +++ b/Pf2eModel/Model/Structure/Ancestry.cs @@ -1,37 +1,73 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.AncestryRelation; namespace Pf2eModel.Model.Structure; +/// +/// Родословная. +/// [EntityOfType(EntityType.Ancestry)] public class Ancestry : IEntity { - [System.ComponentModel.DataAnnotations.Key] + /// + [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Размеры родословной. + /// [Column(Order = 2)] - public Size[] Size { get; set; } = []; + [Comment("Размеры родословной")] + public SizeEnum[] Size { get; set; } = []; + /// + /// Количество очков здоровья. + /// [Column(Order = 3)] + [Comment("Количество очков здоровья")] public int Hp { get; set; } + /// + /// Скорость передвижения. + /// [Column(Order = 4)] + [Comment("Скорость передвижения")] public int Speed { get; set; } + /// + /// Тип зрения. + /// [Column(Order = 5)] - public AncestryVision Vision { get; set; } = AncestryVision.Normal; + [Comment("Тип зрения")] + public VisionEnum VisionEnum { get; set; } = VisionEnum.Normal; + /// + /// Коллекция повышениий аттрибутов. + /// public ICollection AncestryBoosts { get; set; } = []; + /// + /// Коллекция сущностей родословной. + /// public ICollection AncestryItems { get; set; } = []; + /// + /// Коллекция языков родословной. + /// public ICollection AncestryLanguages { get; set; } = []; + /// + /// Коллекция наследий. + /// public ICollection Heritages { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Archetype.cs b/Pf2eModel/Model/Structure/Archetype.cs index bc65a80..bb5da5d 100644 --- a/Pf2eModel/Model/Structure/Archetype.cs +++ b/Pf2eModel/Model/Structure/Archetype.cs @@ -1,30 +1,55 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Архетип. +/// [EntityOfType(EntityType.Archetype)] public class Archetype : IEntity { + /// [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Уровень. + /// [Column(Order = 2)] + [Comment("Уровень")] public int Level { get; set; } + /// + /// Идентификатор способности, которая является посвящением в архетип. + /// [Column(Order = 3)] + [Comment("ID посвящения")] public int? DedicationFeatId { get; set; } = null; + /// + /// Дополнительная информация об архетипе. + /// [Column(Order = 4)] - // ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength + [Comment("Дополнительная информация")] public string? Extra { get; set; } + /// + /// Посвящение в архетип. + /// public Feat DedicationFeat { get; set; } = null!; + /// + /// Способности архетипа. + /// public ICollection Feats { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Background.cs b/Pf2eModel/Model/Structure/Background.cs index 5ed8b3b..4f6ec15 100644 --- a/Pf2eModel/Model/Structure/Background.cs +++ b/Pf2eModel/Model/Structure/Background.cs @@ -1,24 +1,40 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.BackgroundRelation; namespace Pf2eModel.Model.Structure; +/// +/// Предыстория. +/// [EntityOfType(EntityType.Background)] public class Background : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Аттрибуты предыстории. + /// public ICollection BackgroundBoosts { get; set; } = []; + /// + /// Способности предыстории. + /// public ICollection BackgroundItems { get; set; } = []; + /// + /// Навыки предыстории. + /// public ICollection BackgroundSkills { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Class.cs b/Pf2eModel/Model/Structure/Class.cs index d07330d..1bb9cfa 100644 --- a/Pf2eModel/Model/Structure/Class.cs +++ b/Pf2eModel/Model/Structure/Class.cs @@ -1,40 +1,73 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.ClassRelation; namespace Pf2eModel.Model.Structure; +/// +/// Класс. +/// [EntityOfType(EntityType.Class)] public class Class : IEntity { + /// [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; - [Column(Order = 3)] + /// + /// Количество очков здоровья. + /// + [Column(Order = 2)] + [Comment("Количество очков здоровья")] public int Hp { get; set; } - [Column(Order = 4)] - public int Perception { get; set; } - - [Column(Order = 5)] + /// + /// Флаг, указывающий на то, что класс является заклинательным. + /// + [Column(Order = 3)] + [Comment("Заклинатель?")] public bool Spellcasting { get; set; } + /// + /// Традиция заклинаний класса. + /// [Column(Order = 6)] - public SpellTradition Tradition { get; set; } + [Comment("Традиция заклинаний")] + public SpellTradition? Tradition { get; set; } = null; + /// + /// Количество дополнительных навыков. + /// [Column(Order = 7)] + [Comment("Дополнительные навыки")] public int AdditionalTrainedSkills { get; set; } + /// + /// Аттрибуты класса. + /// public virtual ICollection ClassKeyAbilities { get; set; } = []; + /// + /// Прогрессия класса. + /// public virtual ICollection ClassProgressions { get; set; } = []; + /// + /// Навыки класса. + /// public virtual ICollection ClassTrainings { get; set; } = []; + /// + /// Группы подклассов. + /// public virtual ICollection SubclassGroups { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Condition.cs b/Pf2eModel/Model/Structure/Condition.cs index 9fbe564..03c981f 100644 --- a/Pf2eModel/Model/Structure/Condition.cs +++ b/Pf2eModel/Model/Structure/Condition.cs @@ -1,24 +1,38 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Состояние. +/// [EntityOfType(EntityType.Condition)] public class Condition : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Группа состояния. + /// [Column(Order = 2)] + [Comment("Группа состояния")] public ConditionGroup? Group { get; set; } + /// + /// Дополнительная информация. + /// [Column(Order = 3)] - // ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength + [Comment("Дополнительная информация")] public string? Extra { get; set; } } diff --git a/Pf2eModel/Model/Structure/Deity.cs b/Pf2eModel/Model/Structure/Deity.cs index 0e91fdc..0f34c08 100644 --- a/Pf2eModel/Model/Structure/Deity.cs +++ b/Pf2eModel/Model/Structure/Deity.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Common; using Pf2eModel.Model.Enum; @@ -7,35 +8,72 @@ using Pf2eModel.Model.Structure.DeityRelation; namespace Pf2eModel.Model.Structure; +/// +/// Божество. +/// [EntityOfType(EntityType.Deity)] public class Deity : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Тип божества. + /// [Column(Order = 2)] + [Comment("Тип божества")] public DeityCategory Category { get; set; } + /// + /// Тип божественный силы. + /// [Column(Order = 3)] + [Comment("Тип божественной силы")] public DeityFonts Fonts { get; set; } + /// + /// Тип освящения. + /// [Column(Order = 4)] + [Comment("Тип освящения")] public DeitySanctification Sanctification { get; set; } + /// + /// Обязательное освящение. + /// [Column(Order = 5)] + [Comment("Обязательное освящение")] public bool SanctificationMust { get; set; } + /// + /// Аттрибуты божества. + /// public ICollection DeityAttributes { get; set; } = new List(); + /// + /// Домены божества. + /// public ICollection DeityDomains { get; set; } = new List(); + /// + /// Заклинания божества. + /// public ICollection DeitySpells { get; set; } = new List(); + /// + /// Оружия божества. + /// public ICollection DeityWeapons { get; set; } = new List(); + /// + /// Навыки божества. + /// public ICollection Skills { get; set; } = new List(); } diff --git a/Pf2eModel/Model/Structure/Feat.cs b/Pf2eModel/Model/Structure/Feat.cs index 3762df0..8dd05c5 100644 --- a/Pf2eModel/Model/Structure/Feat.cs +++ b/Pf2eModel/Model/Structure/Feat.cs @@ -1,28 +1,44 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.FeatRelation; namespace Pf2eModel.Model.Structure; +/// +/// Способность. +/// [EntityOfType(EntityType.Feat)] public class Feat : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Категория способности. + /// [Column(Order = 3)] - public ActionCategory Category { get; set; } + [Comment("Категория способности")] + public FeatCategory Category { get; set; } + /// + /// Уровень способности. + /// [Column(Order = 4)] + [Comment("Уровень способности")] public int Level { get; set; } [Column(Order = 5)] + [Comment("Количество действий")] public int? Actions { get; set; } = null; [Column(Order = 6)] @@ -37,11 +53,20 @@ public class Feat : IEntity [Column(Order = 9)] public bool IsPassive { get; set; } = false; + /// + /// Дополнительная информация. + /// [Column(Order = 10)] - // ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength + [Comment("Дополнительная информация")] public string? Extra { get; set; } + /// + /// Архетипы, которые могут использовать эту способность. + /// public ICollection Archetypes { get; set; } = []; + /// + /// Требования к получению способности. + /// public ICollection FeatPrerequisites { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Heritage.cs b/Pf2eModel/Model/Structure/Heritage.cs index c9d04c9..25bf6b8 100644 --- a/Pf2eModel/Model/Structure/Heritage.cs +++ b/Pf2eModel/Model/Structure/Heritage.cs @@ -1,22 +1,36 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Наследие. +/// [EntityOfType(EntityType.Heritage)] public class Heritage : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Идентификатор родословной. + /// [Column(Order = 2)] + [Comment("Идентификатор родословной")] public int? AncestryId { get; set; } - public virtual Ancestry? Ancestry { get; set; } + /// + /// Родословная. + /// + public Ancestry? Ancestry { get; set; } } diff --git a/Pf2eModel/Model/Structure/Language.cs b/Pf2eModel/Model/Structure/Language.cs index c9072d7..b2da393 100644 --- a/Pf2eModel/Model/Structure/Language.cs +++ b/Pf2eModel/Model/Structure/Language.cs @@ -1,17 +1,24 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Язык. +/// [EntityOfType(EntityType.Language)] public class Language : IEntity { + /// [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; } diff --git a/Pf2eModel/Model/Structure/Ritual.cs b/Pf2eModel/Model/Structure/Ritual.cs index 0b72f97..bfcb46a 100644 --- a/Pf2eModel/Model/Structure/Ritual.cs +++ b/Pf2eModel/Model/Structure/Ritual.cs @@ -8,60 +8,127 @@ using Pf2eModel.Model.Structure.RitualRelation; namespace Pf2eModel.Model.Structure; +/// +/// Ритуал. +/// [EntityOfType(EntityType.Ritual)] public class Ritual : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + + /// public Entity Entity { get; set; } = null!; + /// + /// Уровень ритуала. + /// [Column(Order = 2)] + [Comment("Уровень ритуала")] public int Level { get; set; } + /// + /// Продолжительность ритуала в секундах. + /// [Column(Order = 3)] [Comment("Продолжительность ритуала в секундах")] public int CastTime { get; set; } + /// + /// Время действия эффекта ритуала в секундах. + /// [Column(Order = 4)] [Comment("Время действия эффекта ритуала в секундах")] public int Duration { get; set; } + /// + /// Элементы ритуала. + /// [Column(Order = 5)] + [Comment("Элементы ритуала")] public ElementEnum[] Elements { get; set; } = []; + /// + /// Дальнность ритуала в футах. + /// [Column(Order = 6)] + [Comment("Дальнность ритуала")] public int Range { get; set; } + /// + /// Ранг основной проверки. + /// [Column(Order = 7)] + [Comment("Ранг основной проверки")] public TrainingRank PrimaryCheckRank { get; set; } = TrainingRank.Trained; + /// + /// Дополнительная информация об основной проверки. + /// [Column(Order = 8)] + [Comment("Дополнительная информация об основной проверки")] public LocaleString? PrimaryCheckSuffix { get; set; } = null; + /// + /// Количество дополнительных заклинателей, необходимых для ритуала. + /// [Column(Order = 9)] + [Comment("Количество дополнительных заклинателей")] public int SecondaryCasters { get; set; } = 0; + /// + /// Максимальное количество дополнительных заклинателей, необходимых для ритуала. + /// [Column(Order = 10)] + [Comment("Максимальное количество дополнительных заклинателей")] public int SecondaryCastersMax { get; set; } = 0; + /// + /// Дополнительная информация о дополнительных заклинателях. + /// [Column(Order = 11)] + [Comment("Дополнительная информация о дополнительных заклинателях")] public LocaleString? SecondaryCastersSuffix { get; set; } = null; + /// + /// Строка, описывающая дальность ритуала. + /// [Column(Order = 12)] + [Comment("Дальность ритуала")] public LocaleString? RangeString { get; set; } = null; + /// + /// Строка, описывающая цель ритуала. + /// [Column(Order = 13)] + [Comment("Цель ритуала")] public LocaleString? Target { get; set; } = null; + /// + /// Строка, описывающая стоимость ритуала. + /// [Column(Order = 14)] + [Comment("Стоимость ритуала")] public LocaleString? Cost { get; set; } = null; + /// + /// Строка, описывающая требования к ритуалу. + /// [Column(Order = 15)] + [Comment("Требования к ритуалу")] public LocaleString? Requirement { get; set; } = null; - public virtual RitualArea? Area { get; set; } = null; + /// + /// Коллекция областей ритуала. + /// + public RitualArea? Area { get; set; } = null; - public virtual ICollection Checks { get; set; } = []; + /// + /// Коллекция проверок ритуала. + /// + public ICollection Checks { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Rule.cs b/Pf2eModel/Model/Structure/Rule.cs index 2cefc47..26eab4b 100644 --- a/Pf2eModel/Model/Structure/Rule.cs +++ b/Pf2eModel/Model/Structure/Rule.cs @@ -1,29 +1,53 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Правило. +/// [EntityOfType(EntityType.Rule)] public class Rule : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Порядок отображения. + /// [Column(Order = 2)] + [Comment("Порядок отображения")] public int Order { get; set; } + /// + /// Идентификатор родительского правила. + /// [Column(Order = 3)] + [Comment("Родительского правило")] public int? ParentId { get; set; } = null; + /// + /// Родительское правило. + /// public Rule? Parent { get; set; } = null; + /// + /// Дочерние правила. + /// public ICollection Children { get; set; } = []; + /// + /// Хлебные крошки для отображения в интерфейсе. + /// public string[] Breadcrumbs { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Spell.cs b/Pf2eModel/Model/Structure/Spell.cs index d92949e..11c1feb 100644 --- a/Pf2eModel/Model/Structure/Spell.cs +++ b/Pf2eModel/Model/Structure/Spell.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; @@ -7,48 +8,97 @@ using Pf2eModel.Model.Structure.SpellRelation; namespace Pf2eModel.Model.Structure; +/// +/// Заклинание. +/// [EntityOfType(EntityType.Spell)] public class Spell : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Уровень заклинания. + /// [Column(Order = 2)] public int Level { get; set; } + /// + /// Является ли заклинание фокусом. + /// [Column(Order = 3)] + [Comment("Фокус?")] public bool IsFocus { get; set; } + /// + /// Количество действий, необходимых для применения заклинания. + /// [Column(Order = 4)] + [Comment("Количество действий")] public ActionEnum Actions { get; set; } = ActionEnum.Other; + /// + /// Время длительности заклинания в секундах. + /// [Column(Order = 5)] [MaxLength(255)] + [Comment("Время длительности заклинания")] public int? Duration { get; set; } = null; + /// + /// Дальность заклинания в футах. + /// [Column(Order = 6)] + [Comment("Дальность заклинания")] public int Range { get; set; } + /// + /// Традиции заклинания. + /// [Column(Order = 7)] + [Comment("Традиции заклинания")] public SpellTradition[] Traditions { get; set; } = []; + /// + /// Элементы заклинания. + /// [Column(Order = 8)] + [Comment("Элементы заклинания")] public ElementEnum[] Elements { get; set; } = []; + /// + /// Триггер заклинания. + /// [Column(Order = 9)] + [Comment("Триггер заклинания")] public LocaleString? Trigger { get; set; } = null; + /// + /// Цель заклинания. + /// [Column(Order = 10)] + [Comment("Цель заклинания")] public LocaleString? Target { get; set; } = null; + /// + /// Стоимость заклинания. + /// [Column(Order = 11)] + [Comment("Стоимость заклинания")] public LocaleString? Cost { get; set; } = null; + /// + /// Требования к заклинанию. + /// [Column(Order = 12)] + [Comment("Требования к заклинанию")] public LocaleString? Requirement { get; set; } = null; /* @@ -78,7 +128,13 @@ public class Spell : IEntity public bool CanHeightening { get; set; } */ - public virtual ICollection SpellAreas { get; set; } = []; + /// + /// Коллекция области заклинания. + /// + public ICollection SpellAreas { get; set; } = []; - public virtual ICollection SpellDefenses { get; set; } = new List(); + /// + /// Коллекция защиты от заклинания. + /// + public ICollection SpellDefenses { get; set; } = new List(); } diff --git a/Pf2eModel/Model/Structure/Subclass.cs b/Pf2eModel/Model/Structure/Subclass.cs index 8b1e4e3..73cfb86 100644 --- a/Pf2eModel/Model/Structure/Subclass.cs +++ b/Pf2eModel/Model/Structure/Subclass.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; @@ -7,28 +8,48 @@ using Pf2eModel.Model.Structure.ClassRelation; namespace Pf2eModel.Model.Structure; +/// +/// Подкласс. +/// [EntityOfType(EntityType.Subclass)] public class Subclass : IEntity { + /// [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Идетификатор группы подклассов. + /// [Column(Order = 2)] + [Comment("Группа подклассов")] public int GroupId { get; set; } + /// + /// Группа подклассов. + /// public SubclassGroup Group { get; set; } = null!; + /// + /// Дополнительная информация. + /// [Column(Order = 3)] + [Comment("Дополнительная информация")] public LocaleString Additional { get; set; } = []; + /// + /// Дополнительная информация в формате JSON. + /// [Column(Order = 4)] - // ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength public string Extra { get; set; } = "{}"; - public virtual ICollection Entities { get; set; } = []; + public ICollection Entities { get; set; } = []; - public virtual ICollection Trainings { get; set; } = []; + public ICollection Trainings { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/SubclassGroup.cs b/Pf2eModel/Model/Structure/SubclassGroup.cs index 017d586..45529eb 100644 --- a/Pf2eModel/Model/Structure/SubclassGroup.cs +++ b/Pf2eModel/Model/Structure/SubclassGroup.cs @@ -1,23 +1,41 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Группа подклассов. +/// [EntityOfType(EntityType.SubclassGroup)] public class SubclassGroup : IEntity { + /// [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Идентификатор класса. + /// [Column(Order = 2)] + [Comment("Идентификатор класса")] public int? ClassId { get; set; } = null; + /// + /// Класс, к которому относится группа подклассов. + /// public Class? Class { get; set; } = null!; + /// + /// Коллекция подклассов, относящихся к этой группе. + /// public ICollection Subclasses { get; set; } = []; } diff --git a/Pf2eModel/Model/Structure/Trait.cs b/Pf2eModel/Model/Structure/Trait.cs index ac6db44..42c4dba 100644 --- a/Pf2eModel/Model/Structure/Trait.cs +++ b/Pf2eModel/Model/Structure/Trait.cs @@ -1,23 +1,36 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Enum; namespace Pf2eModel.Model.Structure; +/// +/// Признак. +/// [EntityOfType(EntityType.Trait)] public class Trait : IEntity { + /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [Column(Order = 1)] + [Comment("Идентификатор")] public int Id { get; set; } + /// public Entity Entity { get; set; } = null!; + /// + /// Тип признака. + /// [Column(Order = 2)] + [Comment("Тип признака")] public TraitType Type { get; set; } - [Newtonsoft.Json.JsonIgnore] - public virtual ICollection Entities { get; set; } = []; + /// + /// Сущности, которые имеют данный признак. + /// + public ICollection Entities { get; set; } = []; } diff --git a/Pf2eModel/Pf2eDbContext.cs b/Pf2eModel/Pf2eDbContext.cs index 8b37bd2..4bcf998 100644 --- a/Pf2eModel/Pf2eDbContext.cs +++ b/Pf2eModel/Pf2eDbContext.cs @@ -19,6 +19,9 @@ using Pf2eModel.Model.Structure.SpellRelation; namespace Pf2eModel; +/// +/// Контекст базы данных. +/// public partial class Pf2eDbContext : DbContext { public Pf2eDbContext() { } @@ -118,6 +121,7 @@ public partial class Pf2eDbContext : DbContext #endregion + /// protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { DotEnv.Load(options: new DotEnvOptions(probeForEnv: true, probeLevelsToSearch: 2)); @@ -131,28 +135,28 @@ public partial class Pf2eDbContext : DbContext builder => { builder - .MapEnum() - .MapEnum() - .MapEnum() .MapEnum() - .MapEnum() .MapEnum() - .MapEnum() - .MapEnum() + .MapEnum() + .MapEnum() .MapEnum() .MapEnum() .MapEnum() .MapEnum() .MapEnum() - .MapEnum() + .MapEnum() + .MapEnum() + .MapEnum() .MapEnum() + .MapEnum() + .MapEnum() .MapEnum() .MapEnum() .MapEnum() .MapEnum() - .MapEnum() .MapEnum() - .MapEnum(); + .MapEnum() + .MapEnum(); } ); } diff --git a/Pf2eModel/Pf2eDbContextModel.cs b/Pf2eModel/Pf2eDbContextModel.cs index d898dd9..5966a03 100644 --- a/Pf2eModel/Pf2eDbContextModel.cs +++ b/Pf2eModel/Pf2eDbContextModel.cs @@ -23,28 +23,45 @@ using Pf2eModel.Model.Structure.SpellRelation; namespace Pf2eModel; -[SuppressMessage("ReSharper", "UnusedParameter.Local")] +/// +[SuppressMessage("ReSharper", "InconsistentNaming")] public partial class Pf2eDbContext { + /// + /// Длина названия сущности. + /// public const int NameLength = 255; + /// protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.UseIdentityByDefaultColumns(); - DefineEnums(modelBuilder); + // DefineEnums(modelBuilder); DefineBase(modelBuilder); DefineCommon(modelBuilder); DefineStructure(modelBuilder); DefineMethods(modelBuilder); } + /// + /// Устанавливает связь между сущностью и её корневой сущностью. + /// + /// Тип сущности. + /// Генератор настроек таблицы сущности. private void BindEntity(EntityTypeBuilder entity) where T : class, IEntity { entity.HasOne(e => e.Entity).WithOne().HasForeignKey(e => e.Id).IsRequired(); } + /// + /// Устанавливает связь между сущностью и локализованной строкой. + /// + /// Тип сущности. + /// Генератор настроек таблицы сущности. + /// Функция, выбирающая поле сущности. + /// Флаг, указывающий, что локализованная строка не может быть `null`. private void BindLocaleString( EntityTypeBuilder entity, Expression> func, @@ -59,33 +76,41 @@ public partial class Pf2eDbContext .IsRequired(required); } + /// + /// Определяет перечисления, используемые в модели. + /// + /// Построитель модели. private void DefineEnums(ModelBuilder modelBuilder) { modelBuilder - .HasPostgresEnum() - .HasPostgresEnum() - .HasPostgresEnum() .HasPostgresEnum() - .HasPostgresEnum() .HasPostgresEnum() - .HasPostgresEnum() - .HasPostgresEnum() + .HasPostgresEnum() + .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() - .HasPostgresEnum() + .HasPostgresEnum() + .HasPostgresEnum() + .HasPostgresEnum() .HasPostgresEnum() + .HasPostgresEnum() + .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() .HasPostgresEnum() - .HasPostgresEnum() .HasPostgresEnum() - .HasPostgresEnum(); + .HasPostgresEnum() + .HasPostgresEnum(); } + /// + /// Определяет базовые сущности и их связи. + /// + /// Построитель модели. private void DefineBase(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => @@ -151,6 +176,10 @@ public partial class Pf2eDbContext modelBuilder.Entity(entity => { }); } + /// + /// Определяет общие сущности и их связи. + /// + /// Построитель модели. private void DefineCommon(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { }); @@ -163,6 +192,10 @@ public partial class Pf2eDbContext }); } + /// + /// Определяет структуру сущностей и их связи. + /// + /// Построитель модели. private void DefineStructure(ModelBuilder modelBuilder) { // Action @@ -517,6 +550,10 @@ public partial class Pf2eDbContext }); } + /// + /// Определяет методы, которые будут использоваться в запросах LINQ. + /// + /// Построитель модели. private void DefineMethods(ModelBuilder modelBuilder) { MethodInfo localeSearch = typeof(Pf2eDbContext).GetMethod(