135 lines
4.4 KiB
C#
135 lines
4.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Pf2e.Database.Model.Base.Keywords;
|
|
using Pf2e.Database.Model.Base.Source;
|
|
using Pf2e.Database.Model.Base.Targets;
|
|
using Pf2e.Database.Model.Common.I18n;
|
|
using Pf2e.Database.Model.Enum;
|
|
using Pf2e.Database.Model.Structure;
|
|
|
|
namespace Pf2e.Database.Model.Base;
|
|
|
|
/// <summary>
|
|
/// Корневая сущность.
|
|
/// </summary>
|
|
public class Entity
|
|
{
|
|
/// <summary>
|
|
/// Идентификатор сущности.
|
|
/// </summary>
|
|
[Key]
|
|
[Column(Order = 1)]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Отображаемое имя сущности.
|
|
/// </summary>
|
|
[Column(Order = 2)]
|
|
[Comment("Отображаемое имя")]
|
|
public LocaleString Name { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Тип сущности.
|
|
/// </summary>
|
|
[Column(Order = 3)]
|
|
[Comment("Тип сущности")]
|
|
public EntityType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Часть имени в URL.
|
|
/// </summary>
|
|
[Column(Order = 4)]
|
|
[MaxLength(Pf2eDbContext.NameLength)]
|
|
[Comment("Часть имени в URL")]
|
|
public string Slug { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Изображение сущности.
|
|
/// </summary>
|
|
[Column(Order = 5)]
|
|
[StringLength(255)]
|
|
[Comment("Изображение объекта")]
|
|
public string Img { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Текстовое описание сущности.
|
|
/// </summary>
|
|
[Column(Order = 6)]
|
|
[Comment("Текстовое описание сущности")]
|
|
public string Description { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Редкость сущности.
|
|
/// </summary>
|
|
[Column(Order = 7)]
|
|
[Comment("Редкость сущности")]
|
|
public EntityRarity Rarity { get; set; } = EntityRarity.Common;
|
|
|
|
/// <summary>
|
|
/// Флаг, указывающий, что у объекта существует перевод.
|
|
/// </summary>
|
|
[Column(Order = 8)]
|
|
[Comment("Есть перевод?")]
|
|
public bool? IsTranslated { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи.
|
|
/// </summary>
|
|
[Column(Order = 9)]
|
|
[Comment("Проверено?")]
|
|
public bool? IsChecked { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Флаг, указывающий, что сущность является устаревшей.
|
|
/// </summary>
|
|
[Column(Order = 10)]
|
|
[Comment("Устаревшая?")]
|
|
public bool? IsLegacy { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Коллекция алиасов
|
|
/// </summary>
|
|
public ICollection<EntityAlias> Aliases { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция признаков, связанных с сущностью.
|
|
/// </summary>
|
|
public ICollection<Trait> Traits { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция ключевых слов, связанных с сущностью.
|
|
/// </summary>
|
|
public ICollection<Keyword> Keywords { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция источников, связанных с сущностью.
|
|
/// </summary>
|
|
public ICollection<EntitySource> Sources { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция внешних ссылок, связанных с сущностью.
|
|
/// </summary>
|
|
public ICollection<EntityExternal> Externals { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция устаревших сущностей.
|
|
/// </summary>
|
|
public ICollection<Entity> LegacyEntities { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция переходных объектов для устаревших сущностей.
|
|
/// </summary>
|
|
public ICollection<LegacyRemaster> LegacyTransferEntities { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция обновлённых сущностей.
|
|
/// </summary>
|
|
public ICollection<Entity> RemasterEntities { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Коллекция переходных объектов для обновлённых сущностей.
|
|
/// </summary>
|
|
public ICollection<LegacyRemaster> RemasterTransferEntities { get; set; } = [];
|
|
}
|