using System.ComponentModel.DataAnnotations.Schema; using SVSim.Database.Common; using Microsoft.EntityFrameworkCore; namespace SVSim.Database.Models; /// /// A user within the game system. /// [Index(nameof(ShortUdid))] [Index(nameof(Udid), IsUnique = true)] public class Viewer : BaseEntity { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public override long Id { get; set; } /// /// This user's name displayed in game. /// public string DisplayName { get; set; } = String.Empty; /// /// This user's short identifier. /// public long ShortUdid { get; set; } /// /// The client's full UDID (AES key for the wire protocol). Set when the viewer is created /// via /tool/signup; null for viewers created via the admin Steam-import path. Unique /// when present — the partial filter is declared in the migration. /// public Guid? Udid { get; set; } public DateTime LastLogin { get; set; } #region Owned public ViewerInfo Info { get; set; } = new ViewerInfo(); public ViewerMissionData MissionData { get; set; } = new ViewerMissionData(); public ViewerCurrency Currency { get; set; } = new ViewerCurrency(); public List Classes { get; set; } = new List(); #endregion #region Collection public List Decks { get; set; } = new List(); public List Cards { get; set; } = new List(); public List LeaderSkins { get; set; } = new List(); public List Degrees { get; set; } = new List(); public List Emblems { get; set; } = new List(); public List Items { get; set; } = new List(); public List Sleeves { get; set; } = new List(); public List MyPageBackgrounds { get; set; } = new List(); public List PackOpenCounts { get; set; } = new List(); public List BuildDeckPurchases { get; set; } = new List(); public List Missions { get; set; } = new List(); public List Achievements { get; set; } = new List(); public List EventCounters { get; set; } = new List(); #endregion #region Navigation Properties public List SocialAccountConnections { get; set; } = new List(); #endregion }