Документирование и небольшой рефакторинг модели.

This commit is contained in:
2025-05-11 00:31:15 +04:00
parent 1a977ee988
commit 3c65274b45
64 changed files with 1960 additions and 554 deletions
+58 -2
View File
@@ -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;
/// <summary>
/// Заклинание.
/// </summary>
[EntityOfType(EntityType.Spell)]
public class Spell : IEntity
{
/// <inheritdoc/>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column(Order = 1)]
[Comment("Идентификатор")]
public int Id { get; set; }
/// <inheritdoc/>
public Entity Entity { get; set; } = null!;
/// <summary>
/// Уровень заклинания.
/// </summary>
[Column(Order = 2)]
public int Level { get; set; }
/// <summary>
/// Является ли заклинание фокусом.
/// </summary>
[Column(Order = 3)]
[Comment("Фокус?")]
public bool IsFocus { get; set; }
/// <summary>
/// Количество действий, необходимых для применения заклинания.
/// </summary>
[Column(Order = 4)]
[Comment("Количество действий")]
public ActionEnum Actions { get; set; } = ActionEnum.Other;
/// <summary>
/// Время длительности заклинания в секундах.
/// </summary>
[Column(Order = 5)]
[MaxLength(255)]
[Comment("Время длительности заклинания")]
public int? Duration { get; set; } = null;
/// <summary>
/// Дальность заклинания в футах.
/// </summary>
[Column(Order = 6)]
[Comment("Дальность заклинания")]
public int Range { get; set; }
/// <summary>
/// Традиции заклинания.
/// </summary>
[Column(Order = 7)]
[Comment("Традиции заклинания")]
public SpellTradition[] Traditions { get; set; } = [];
/// <summary>
/// Элементы заклинания.
/// </summary>
[Column(Order = 8)]
[Comment("Элементы заклинания")]
public ElementEnum[] Elements { get; set; } = [];
/// <summary>
/// Триггер заклинания.
/// </summary>
[Column(Order = 9)]
[Comment("Триггер заклинания")]
public LocaleString? Trigger { get; set; } = null;
/// <summary>
/// Цель заклинания.
/// </summary>
[Column(Order = 10)]
[Comment("Цель заклинания")]
public LocaleString? Target { get; set; } = null;
/// <summary>
/// Стоимость заклинания.
/// </summary>
[Column(Order = 11)]
[Comment("Стоимость заклинания")]
public LocaleString? Cost { get; set; } = null;
/// <summary>
/// Требования к заклинанию.
/// </summary>
[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<SpellArea> SpellAreas { get; set; } = [];
/// <summary>
/// Коллекция области заклинания.
/// </summary>
public ICollection<SpellArea> SpellAreas { get; set; } = [];
public virtual ICollection<SpellDefense> SpellDefenses { get; set; } = new List<SpellDefense>();
/// <summary>
/// Коллекция защиты от заклинания.
/// </summary>
public ICollection<SpellDefense> SpellDefenses { get; set; } = new List<SpellDefense>();
}