Работа над импортом заклинаний
This commit is contained in:
@@ -7,18 +7,24 @@ namespace Pf2eModel.Model.Base.Targets;
|
||||
[PrimaryKey(nameof(EntityId), nameof(TargetId))]
|
||||
public class EntityExternal
|
||||
{
|
||||
[Column(Order = 0)]
|
||||
[Column(Order = 1)]
|
||||
public int EntityId { get; set; }
|
||||
|
||||
[Column(Order = 1)]
|
||||
[Column(Order = 2)]
|
||||
public int TargetId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
/*
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(255)]
|
||||
public string ExternalId { get; set; } = "";
|
||||
*/
|
||||
|
||||
[Column(Order = 4)]
|
||||
[MaxLength(255)]
|
||||
[Comment("Часть URL до объекта. Для источников Foundry - полный UUID объекта")]
|
||||
public string Suffix { get; set; } = "";
|
||||
|
||||
[Column(Order = 3)]
|
||||
[Column(Order = 5)]
|
||||
[MaxLength(32)]
|
||||
[Comment("Контроль версии объекта")]
|
||||
public string Md5 { get; set; } = null!;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Common;
|
||||
@@ -12,8 +13,7 @@ public class Training
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
[MaxLength(Pf2eDbContext.NameLength)]
|
||||
public string Name { get; set; } = null!;
|
||||
public LocaleString Name { get; set; } = [];
|
||||
|
||||
[Column(Order = 3)]
|
||||
public TrainingType Type { get; set; }
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum ActionEnum
|
||||
{
|
||||
[PgName("unknown")]
|
||||
Unknown,
|
||||
|
||||
[PgName("1")]
|
||||
SingleAction,
|
||||
|
||||
[PgName("2")]
|
||||
TwoActions,
|
||||
|
||||
[PgName("3")]
|
||||
ThreeActions,
|
||||
|
||||
[PgName("reaction")]
|
||||
Reaction,
|
||||
|
||||
[PgName("free")]
|
||||
FreeAction,
|
||||
|
||||
[PgName("passive")]
|
||||
Passive,
|
||||
|
||||
[PgName("other")]
|
||||
Other,
|
||||
|
||||
[PgName("1-3")]
|
||||
SingleActionToThreeActions,
|
||||
|
||||
[PgName("1-2")]
|
||||
SingleActionToTwoActions,
|
||||
|
||||
[PgName("2-3")]
|
||||
TwoActionsToThreeActions,
|
||||
|
||||
[PgName("2/2 rounds")]
|
||||
TwoActionsToTwoRounds,
|
||||
|
||||
[PgName("reaction/1")]
|
||||
ReactionOrOneAction,
|
||||
|
||||
[PgName("reaction/2")]
|
||||
ReactionOrTwoAction,
|
||||
|
||||
[PgName("reaction/3")]
|
||||
ReactionOrThreeAction,
|
||||
|
||||
[PgName("free/1")]
|
||||
FreeActionOrOneAction,
|
||||
|
||||
[PgName("1 minute")]
|
||||
OneMinute,
|
||||
|
||||
[PgName("5 minutes")]
|
||||
FiveMinutes,
|
||||
|
||||
[PgName("10 minutes")]
|
||||
TenMinutes,
|
||||
|
||||
[PgName("30 minutes")]
|
||||
ThirtyMinutes,
|
||||
|
||||
[PgName("1 hour")]
|
||||
OneHour,
|
||||
}
|
||||
@@ -24,4 +24,16 @@ public enum SpellAreaType
|
||||
|
||||
[PgName("cylinder")]
|
||||
Cylinder,
|
||||
|
||||
[PgName("varies")]
|
||||
Varies,
|
||||
|
||||
[PgName("cuboid")]
|
||||
Cuboid,
|
||||
|
||||
[PgName("circle")]
|
||||
Circle,
|
||||
|
||||
[PgName("other")]
|
||||
Other,
|
||||
}
|
||||
|
||||
@@ -12,22 +12,10 @@ public class Action : IEntity
|
||||
[Column(Order = 1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public ActionEnum Actions { get; set; } = ActionEnum.Unknown;
|
||||
|
||||
[Column(Order = 3)]
|
||||
public int? Actions { get; set; } = null;
|
||||
|
||||
[Column(Order = 4)]
|
||||
public int? MaxActions { get; set; } = null;
|
||||
|
||||
[Column(Order = 5)]
|
||||
public bool IsReaction { get; set; } = false;
|
||||
|
||||
[Column(Order = 6)]
|
||||
public bool IsFreeAction { get; set; } = false;
|
||||
|
||||
[Column(Order = 6)]
|
||||
public bool IsPassive { get; set; } = false;
|
||||
|
||||
[Column(Order = 6)]
|
||||
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
|
||||
public string? Extra { get; set; }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Pf2eModel.Model.Structure.ArchetypeRelation;
|
||||
|
||||
[PrimaryKey(nameof(ArchetypeId), nameof(FeatId))]
|
||||
internal class ArchetypeFeats
|
||||
public class ArchetypeFeats
|
||||
{
|
||||
public int ArchetypeId { get; set; }
|
||||
|
||||
|
||||
@@ -20,10 +20,6 @@ public class ClassTraining
|
||||
public int? TrainingId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
[MaxLength(Pf2eDbContext.NameLength)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[Column(Order = 5)]
|
||||
public TrainingStage Stage { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Pf2eModel.Model.Structure.ClassRelation;
|
||||
|
||||
[PrimaryKey(nameof(SubclassId), nameof(EntityId))]
|
||||
public class SubclassProvidedEntities
|
||||
{
|
||||
public int SubclassId { get; set; }
|
||||
|
||||
public int EntityId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Pf2eModel.Model.Common;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Structure.ClassRelation;
|
||||
|
||||
public class SubclassTrainings
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column(Order = 1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public int SubclassId { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
public int TrainingId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
public TrainingStage Stage { get; set; } = TrainingStage.Trained;
|
||||
|
||||
public Subclass Subclass { get; set; } = null!;
|
||||
|
||||
public Training Training { get; set; } = null!;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
@@ -20,7 +21,12 @@ public class Spell : IEntity
|
||||
public int Level { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
public int Cost { get; set; }
|
||||
public ActionEnum Actions { get; set; } = ActionEnum.Other;
|
||||
|
||||
[Column(Order = 4)]
|
||||
public bool IsFocus { get; set; }
|
||||
|
||||
// ---
|
||||
|
||||
[Column(Order = 4)]
|
||||
public bool Counteraction { get; set; }
|
||||
@@ -51,7 +57,9 @@ public class Spell : IEntity
|
||||
[Column(Order = 11)]
|
||||
public bool CanHeightening { get; set; }
|
||||
|
||||
public virtual SpellArea? SpellArea { get; set; }
|
||||
// ---
|
||||
|
||||
public virtual ICollection<SpellArea> SpellAreas { get; set; } = [];
|
||||
|
||||
public virtual SpellRitual? SpellRitual { get; set; }
|
||||
|
||||
|
||||
@@ -9,16 +9,19 @@ public class SpellArea
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Column(Order = 1)]
|
||||
public int SpellId { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public int SpellId { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(255)]
|
||||
public string? Details { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
[Column(Order = 4)]
|
||||
public SpellAreaType Type { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
[Column(Order = 5)]
|
||||
public int Value { get; set; }
|
||||
|
||||
public virtual Spell Spell { get; set; } = null!;
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure.ClassRelation;
|
||||
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
@@ -26,4 +27,8 @@ public class Subclass : IEntity
|
||||
[Column(Order = 4)]
|
||||
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
|
||||
public string Extra { get; set; } = "{}";
|
||||
|
||||
public virtual ICollection<Entity> Entities { get; set; } = [];
|
||||
|
||||
public virtual ICollection<SubclassTrainings> Trainings { get; set; } = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user