LANCommander/LANCommander.Launcher.Data/Models/Game.cs
Pat Hartl 6dfc0906ac Refactor launcher library importing, manifests
Switched the library importing in the launcher to work based on a queue. As a new game is added to the queue, it should find any related data and also add it to the queue. This should result in an easier to maintain importer while reducing the load on the launcher's DAL. This may result in more RAM usage while importing. Local manifests have also been refactored to match manifests in import/export LCX files, removing the old manifest format. This is a large breaking change that will probably break existing game installations. A migration will probably have to be created.
2025-11-29 18:24:27 -06:00

52 lines
2.4 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LANCommander.SDK.Enums;
namespace LANCommander.Launcher.Data.Models
{
[Table("Games")]
public class Game : BaseModel
{
public long? IGDBId { get; set; }
public string Title { get; set; }
[Display(Name = "Sort Title")]
public string? SortTitle { get; set; }
[Display(Name = "Directory Name")]
public string? Description { get; set; }
public string? Notes { get; set; }
public bool Installed { get; set; }
public string? InstallDirectory { get; set; }
public string? InstalledVersion { get; set; }
public DateTime? InstalledOn { get; set; }
public string? LatestVersion { get; set; }
[Display(Name = "Released On")]
public DateTime? ReleasedOn { get; set; }
public GameType Type { get; set; }
public Guid? BaseGameId { get; set; }
[ForeignKey(nameof(BaseGameId))]
public virtual Game? BaseGame { get; set; }
public bool Singleplayer { get; set; } = false;
public Guid? EngineId { get; set; }
[ForeignKey(nameof(EngineId))]
public virtual Engine Engine { get; set; }
public virtual ICollection<MultiplayerMode>? MultiplayerModes { get; set; } = new List<MultiplayerMode>();
public virtual ICollection<Genre>? Genres { get; set; } = new List<Genre>();
public virtual ICollection<Tag>? Tags { get; set; } = new List<Tag>();
public virtual ICollection<Category>? Categories { get; set; } = new List<Category>();
public virtual ICollection<Company>? Publishers { get; set; } = new List<Company>();
public virtual ICollection<Company>? Developers { get; set; } = new List<Company>();
public virtual ICollection<Platform>? Platforms { get; set; } = new List<Platform>();
public virtual ICollection<Redistributable>? Redistributables { get; set; } = new List<Redistributable>();
public virtual ICollection<Media>? Media { get; set; } = new List<Media>();
public virtual ICollection<Collection> Collections { get; set; } = new List<Collection>();
public virtual ICollection<Game> DependentGames { get; set; } = new List<Game>();
public virtual ICollection<PlaySession> PlaySessions { get; set; } = new List<PlaySession>();
public virtual ICollection<Library> Libraries { get; set; } = new List<Library>();
}
}