| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| using System.Collections.ObjectModel; |
| using System.Collections.ObjectModel; |
| using System.ComponentModel; |
| using System.ComponentModel; |
| using System.Diagnostics; |
| using System.Diagnostics; |
| using System.IO; |
| using System.IO; |
| using System.Linq; |
| using System.Linq; |
| using System.Text; |
| using System.Text; |
| using System.Threading; |
| using System.Threading; |
| using System.Threading.Tasks; |
| using System.Threading.Tasks; |
| using System.Collections.Concurrent; |
| using System.Collections.Concurrent; |
. | using Newtonsoft.Json; |
| using Playnite.SDK.Data; |
| |
| |
| namespace Playnite.SDK.Models |
| namespace Playnite.SDK.Models |
| { |
| { |
| /// <summary> |
| /// <summary> |
| /// Specifies <see cref="Game"/> fields. |
| /// Specifies <see cref="Game"/> fields. |
| /// </summary> |
| /// </summary> |
. | public enum GameField |
| public enum GameField : int |
| { |
| { |
| /// |
| /// |
. | BackgroundImage, |
| BackgroundImage = 0, |
| /// |
| /// |
. | Description, |
| Description = 1, |
| /// |
| /// |
. | GenreIds, |
| GenreIds = 2, |
| /// |
| /// |
. | Hidden, |
| Hidden = 3, |
| /// |
| /// |
. | Favorite, |
| Favorite = 4, |
| /// |
| /// |
. | Icon, |
| Icon = 5, |
| /// |
| /// |
. | CoverImage, |
| CoverImage = 6, |
| /// |
| /// |
. | InstallDirectory, |
| InstallDirectory = 7, |
| /// |
| /// |
. | GameImagePath, |
| LastActivity = 9, |
| /// |
| /// |
. | LastActivity, |
| SortingName = 10, |
| /// |
| /// |
. | SortingName, |
| Gameid = 11, |
| /// |
| /// |
. | Gameid, |
| PluginId = 12, |
| /// |
| /// |
. | PluginId, |
| PublisherIds = 16, |
| /// |
| /// |
. | OtherActions, |
| DeveloperIds = 17, |
| /// |
| /// |
. | PlayAction, |
| ReleaseDate = 18, |
| /// |
| /// |
. | PlatformId, |
| CategoryIds = 19, |
| /// |
| /// |
. | PublisherIds, |
| TagIds = 20, |
| /// |
| /// |
. | DeveloperIds, |
| Links = 21, |
| /// |
| /// |
. | ReleaseDate, |
| IsInstalling = 22, |
| /// |
| /// |
. | CategoryIds, |
| IsUninstalling = 23, |
| /// |
| /// |
. | TagIds, |
| IsLaunching = 24, |
| /// |
| /// |
. | Links, |
| IsRunning = 25, |
| /// |
| /// |
. | IsInstalling, |
| IsInstalled = 26, |
| /// |
| /// |
. | IsUninstalling, |
| IsCustomGame = 27, |
| /// |
| /// |
. | IsLaunching, |
| Playtime = 28, |
| /// |
| /// |
. | IsRunning, |
| Added = 29, |
| /// |
| /// |
. | IsInstalled, |
| Modified = 30, |
| /// |
| /// |
. | IsCustomGame, |
| PlayCount = 31, |
| /// |
| /// |
. | Playtime, |
| Version = 33, |
| /// |
| /// |
. | Added, |
| SourceId = 36, |
| /// |
| /// |
. | Modified, |
| CompletionStatus = 37, |
| /// |
| /// |
. | PlayCount, |
| UserScore = 38, |
| /// |
| /// |
. | SeriesId, |
| CriticScore = 39, |
| /// |
| /// |
. | Version, |
| CommunityScore = 40, |
| /// |
| /// |
. | AgeRatingId, |
| Genres = 41, |
| /// |
| /// |
. | RegionId, |
| Developers = 42, |
| /// |
| /// |
. | SourceId, |
| Publishers = 43, |
| /// |
| /// |
. | CompletionStatus, |
| Tags = 44, |
| /// |
| /// |
. | UserScore, |
| Categories = 45, |
| /// |
| /// |
. | CriticScore, |
| Source = 50, |
| /// |
| /// |
. | CommunityScore, |
| ReleaseYear = 51, |
| /// |
| /// |
. | Genres, |
| PreScript = 53, |
| /// |
| /// |
. | Developers, |
| PostScript = 54, |
| /// |
| /// |
. | Publishers, |
| Name = 55, |
| /// |
| /// |
. | Tags, |
| Features = 56, |
| /// |
| /// |
. | Categories, |
| FeatureIds = 57, |
| /// |
| /// |
. | Platform, |
| UseGlobalPostScript = 58, |
| /// |
| /// |
. | Series, |
| UseGlobalPreScript = 59, |
| /// |
| /// |
. | AgeRating, |
| UserScoreRating = 60, |
| /// |
| /// |
. | Region, |
| CommunityScoreRating = 61, |
| /// |
| /// |
. | Source, |
| CriticScoreRating = 62, |
| /// |
| /// |
. | ReleaseYear, |
| UserScoreGroup = 63, |
| /// |
| /// |
. | ActionsScriptLanguage, |
| CommunityScoreGroup = 64, |
| /// |
| /// |
. | PreScript, |
| CriticScoreGroup = 65, |
| /// |
| /// |
. | PostScript, |
| LastActivitySegment = 66, |
| /// |
| /// |
. | Name, |
| AddedSegment = 67, |
| /// |
| /// |
. | Features, |
| ModifiedSegment = 68, |
| /// |
| /// |
. | FeatureIds, |
| PlaytimeCategory = 69, |
| /// |
| /// |
. | UseGlobalPostScript, |
| InstallationStatus = 70, |
| /// |
| /// |
. | UseGlobalPreScript, |
| None = 71, |
| /// |
| /// |
. | UserScoreRating, |
| GameStartedScript = 72, |
| /// |
| /// |
. | CommunityScoreRating, |
| UseGlobalGameStartedScript = 73, |
| /// |
| /// |
. | CriticScoreRating, |
| Notes = 74, |
| /// |
| /// |
. | UserScoreGroup, |
| Manual = 75, |
| /// |
| /// |
. | CommunityScoreGroup, |
| GameActions = 76, |
| /// |
| /// |
. | CriticScoreGroup, |
| IncludeLibraryPluginAction = 77, |
| /// |
| /// |
. | LastActivitySegment, |
| Roms = 78, |
| /// |
| /// |
. | AddedSegment, |
| AgeRatingIds = 79, |
| /// |
| /// |
. | ModifiedSegment, |
| AgeRatings = 80, |
| /// |
| /// |
. | PlaytimeCategory, |
| SeriesIds = 81, |
| /// |
| /// |
. | InstallationStatus, |
| Series = 82, |
| /// |
| /// |
. | None, |
| RegionIds = 83, |
| /// |
| /// |
. | GameStartedScript, |
| Regions = 84, |
| /// |
| /// |
. | UseGlobalGameStartedScript, |
| PlatformIds = 85, |
| /// |
| /// |
. | Notes, |
| Platforms = 86, |
| /// |
| /// |
. | Manual |
| CompletionStatusId = 87 |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Represents Playnite game object. |
| /// Represents Playnite game object. |
| /// </summary> |
| /// </summary> |
| public class Game : DatabaseObject |
| public class Game : DatabaseObject |
| { |
| { |
| private string backgroundImage; |
| private string backgroundImage; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets background image. Local file path, HTTP URL or database file ids are supported. |
| /// Gets or sets background image. Local file path, HTTP URL or database file ids are supported. |
| /// </summary> |
| /// </summary> |
| public string BackgroundImage |
| public string BackgroundImage |
| { |
| { |
| get |
| get |
| { |
| { |
| return backgroundImage; |
| return backgroundImage; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| backgroundImage = value; |
| backgroundImage = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string description; |
| private string description; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets HTML game description. |
| /// Gets or sets HTML game description. |
| /// </summary> |
| /// </summary> |
| [DefaultValue("")] |
| [DefaultValue("")] |
| public string Description |
| public string Description |
| { |
| { |
| get |
| get |
| { |
| { |
| return description; |
| return description; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| description = value; |
| description = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string notes; |
| private string notes; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets user notes. |
| /// Gets or sets user notes. |
| /// </summary> |
| /// </summary> |
| [DefaultValue("")] |
| [DefaultValue("")] |
| public string Notes |
| public string Notes |
| { |
| { |
| get |
| get |
| { |
| { |
| return notes; |
| return notes; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| notes = value; |
| notes = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private List<Guid> genreIds; |
| private List<Guid> genreIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets list of genres. |
| /// Gets or sets list of genres. |
| /// </summary> |
| /// </summary> |
| public List<Guid> GenreIds |
| public List<Guid> GenreIds |
| { |
| { |
| get |
| get |
| { |
| { |
| return genreIds; |
| return genreIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| genreIds = value; |
| genreIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Genres)); |
| OnPropertyChanged(nameof(Genres)); |
| } |
| } |
| } |
| } |
| |
| |
| private bool hidden; |
| private bool hidden; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating if the game is hidden in library. |
| /// Gets or sets value indicating if the game is hidden in library. |
| /// </summary> |
| /// </summary> |
| public bool Hidden |
| public bool Hidden |
| { |
| { |
| get |
| get |
| { |
| { |
| return hidden; |
| return hidden; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| hidden = value; |
| hidden = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool favorite; |
| private bool favorite; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets avlue indicating if the game is marked as favorite in library. |
| /// Gets or sets avlue indicating if the game is marked as favorite in library. |
| /// </summary> |
| /// </summary> |
| public bool Favorite |
| public bool Favorite |
| { |
| { |
| get |
| get |
| { |
| { |
| return favorite; |
| return favorite; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| favorite = value; |
| favorite = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string icon; |
| private string icon; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game icon. Local file path, HTTP URL or database file ids are supported. |
| /// Gets or sets game icon. Local file path, HTTP URL or database file ids are supported. |
| /// </summary> |
| /// </summary> |
| public string Icon |
| public string Icon |
| { |
| { |
| get |
| get |
| { |
| { |
| return icon; |
| return icon; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| icon = value; |
| icon = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string coverImage; |
| private string coverImage; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game cover image. Local file path, HTTP URL or database file ids are supported. |
| /// Gets or sets game cover image. Local file path, HTTP URL or database file ids are supported. |
| /// </summary> |
| /// </summary> |
| public string CoverImage |
| public string CoverImage |
| { |
| { |
| get |
| get |
| { |
| { |
| return coverImage; |
| return coverImage; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| coverImage = value; |
| coverImage = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string installDirectory; |
| private string installDirectory; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game installation directory path. |
| /// Gets or sets game installation directory path. |
| /// </summary> |
| /// </summary> |
| public string InstallDirectory |
| public string InstallDirectory |
| { |
| { |
| get |
| get |
| { |
| { |
. | if (string.IsNullOrEmpty(installDirectory)) |
| |
| { |
| |
| if (PlayAction != null) |
| |
| { |
| |
| return PlayAction.WorkingDir; |
| |
| } |
| |
| } |
| |
| |
| |
| return installDirectory; |
| return installDirectory; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| installDirectory = value; |
| installDirectory = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | private string gameImagePath; |
| |
| /// <summary> |
| |
| /// Gets or sets game's ISO, ROM or other type of executable image path. |
| |
| /// </summary> |
| |
| public string GameImagePath |
| |
| { |
| |
| get |
| |
| { |
| |
| return gameImagePath; |
| |
| } |
| |
| |
| |
| set |
| |
| { |
| |
| gameImagePath = value; |
| |
| OnPropertyChanged(); |
| |
| } |
| |
| } |
| |
| |
| |
| private DateTime? lastActivity; |
| private DateTime? lastActivity; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets last played date. |
| /// Gets or sets last played date. |
| /// </summary> |
| /// </summary> |
| public DateTime? LastActivity |
| public DateTime? LastActivity |
| { |
| { |
| get |
| get |
| { |
| { |
| return lastActivity; |
| return lastActivity; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| lastActivity = value; |
| lastActivity = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(LastActivitySegment)); |
| OnPropertyChanged(nameof(LastActivitySegment)); |
| } |
| } |
| } |
| } |
| |
| |
| private string sortingName; |
| private string sortingName; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets optional name used for sorting the game by name. |
| /// Gets or sets optional name used for sorting the game by name. |
| /// </summary> |
| /// </summary> |
| public string SortingName |
| public string SortingName |
| { |
| { |
| get |
| get |
| { |
| { |
| return sortingName; |
| return sortingName; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| sortingName = value; |
| sortingName = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string gameId; |
| private string gameId; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets provider id. For example game's Steam ID. |
| /// Gets or sets provider id. For example game's Steam ID. |
| /// </summary> |
| /// </summary> |
| public string GameId |
| public string GameId |
| { |
| { |
| get |
| get |
| { |
| { |
| return gameId; |
| return gameId; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| gameId = value; |
| gameId = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private Guid pluginId = Guid.Empty; |
| private Guid pluginId = Guid.Empty; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets id of plugin responsible for handling this game. |
| /// Gets or sets id of plugin responsible for handling this game. |
| /// </summary> |
| /// </summary> |
| public Guid PluginId |
| public Guid PluginId |
| { |
| { |
| get |
| get |
| { |
| { |
| return pluginId; |
| return pluginId; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| pluginId = value; |
| pluginId = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | private ObservableCollection<GameAction> otherActions; |
| private bool includeLibraryPluginAction = true; |
| /// <summary> |
| /// <summary> |
. | /// Gets or sets list of additional game actions. |
| /// Gets or sets id of plugin responsible for handling this game. |
| /// </summary> |
| /// </summary> |
. | public ObservableCollection<GameAction> OtherActions |
| public bool IncludeLibraryPluginAction |
| { |
| { |
| get |
| get |
| { |
| { |
. | return otherActions; |
| return includeLibraryPluginAction; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | otherActions = value; |
| includeLibraryPluginAction = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | private GameAction playAction; |
| private ObservableCollection<GameAction> gameActions; |
| /// <summary> |
| /// <summary> |
. | /// Gets or sets game action used to starting the game. |
| /// Gets or sets list of additional game actions. |
| /// </summary> |
| /// </summary> |
. | public GameAction PlayAction |
| public ObservableCollection<GameAction> GameActions |
| { |
| { |
| get |
| get |
| { |
| { |
. | return playAction; |
| return gameActions; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | playAction = value; |
| gameActions = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | private Guid platformId; |
| private List<Guid> platformIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets platform id. |
| /// Gets or sets platform id. |
| /// </summary> |
| /// </summary> |
. | public Guid PlatformId |
| public List<Guid> PlatformIds |
| { |
| { |
| get |
| get |
| { |
| { |
. | return platformId; |
| return platformIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | platformId = value; |
| platformIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
. | OnPropertyChanged(nameof(Platform)); |
| OnPropertyChanged(nameof(Platforms)); |
| } |
| } |
| } |
| } |
| |
| |
| private List<Guid> publisherIds; |
| private List<Guid> publisherIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets list of publishers. |
| /// Gets or sets list of publishers. |
| /// </summary> |
| /// </summary> |
| public List<Guid> PublisherIds |
| public List<Guid> PublisherIds |
| { |
| { |
| get |
| get |
| { |
| { |
| return publisherIds; |
| return publisherIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| publisherIds = value; |
| publisherIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Publishers)); |
| OnPropertyChanged(nameof(Publishers)); |
| } |
| } |
| } |
| } |
| |
| |
| private List<Guid> developerIds; |
| private List<Guid> developerIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets list of developers. |
| /// Gets or sets list of developers. |
| /// </summary> |
| /// </summary> |
| public List<Guid> DeveloperIds |
| public List<Guid> DeveloperIds |
| { |
| { |
| get |
| get |
| { |
| { |
| return developerIds; |
| return developerIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| developerIds = value; |
| developerIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Developers)); |
| OnPropertyChanged(nameof(Developers)); |
| } |
| } |
| } |
| } |
| |
| |
. | private DateTime? releaseDate; |
| private ReleaseDate? releaseDate; |
| /// <summary> |
| /// <summary> |
| /// Gets or set game's release date. |
| /// Gets or set game's release date. |
| /// </summary> |
| /// </summary> |
. | public DateTime? ReleaseDate |
| public ReleaseDate? ReleaseDate |
| { |
| { |
| get |
| get |
| { |
| { |
| return releaseDate; |
| return releaseDate; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| releaseDate = value; |
| releaseDate = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(ReleaseYear)); |
| OnPropertyChanged(nameof(ReleaseYear)); |
| } |
| } |
| } |
| } |
| |
| |
| private List<Guid> categoryIds; |
| private List<Guid> categoryIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game categories. |
| /// Gets or sets game categories. |
| /// </summary> |
| /// </summary> |
| public List<Guid> CategoryIds |
| public List<Guid> CategoryIds |
| { |
| { |
| get |
| get |
| { |
| { |
| return categoryIds; |
| return categoryIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| categoryIds = value; |
| categoryIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Categories)); |
| OnPropertyChanged(nameof(Categories)); |
| } |
| } |
| } |
| } |
| |
| |
| private List<Guid> tagIds; |
| private List<Guid> tagIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets list of tags. |
| /// Gets or sets list of tags. |
| /// </summary> |
| /// </summary> |
| public List<Guid> TagIds |
| public List<Guid> TagIds |
| { |
| { |
| get |
| get |
| { |
| { |
| return tagIds; |
| return tagIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| tagIds = value; |
| tagIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Tags)); |
| OnPropertyChanged(nameof(Tags)); |
| } |
| } |
| } |
| } |
| |
| |
| private List<Guid> featureIds; |
| private List<Guid> featureIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets list of game features. |
| /// Gets or sets list of game features. |
| /// </summary> |
| /// </summary> |
| public List<Guid> FeatureIds |
| public List<Guid> FeatureIds |
| { |
| { |
| get |
| get |
| { |
| { |
| return featureIds; |
| return featureIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| featureIds = value; |
| featureIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Features)); |
| OnPropertyChanged(nameof(Features)); |
| } |
| } |
| } |
| } |
| |
| |
| private ObservableCollection<Link> links; |
| private ObservableCollection<Link> links; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets list of game related web links. |
| /// Gets or sets list of game related web links. |
| /// </summary> |
| /// </summary> |
| public ObservableCollection<Link> Links |
| public ObservableCollection<Link> Links |
| { |
| { |
| get |
| get |
| { |
| { |
| return links; |
| return links; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| links = value; |
| links = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | |
| private ObservableCollection<GameRom> roms; |
| |
| /// <summary> |
| |
| /// Gets or sets list of game ROM files. |
| |
| /// </summary> |
| |
| public ObservableCollection<GameRom> Roms |
| |
| { |
| |
| get |
| |
| { |
| |
| return roms; |
| |
| } |
| |
| |
| |
| set |
| |
| { |
| |
| roms = value; |
| |
| OnPropertyChanged(); |
| |
| } |
| |
| } |
| |
| |
| private bool isInstalling; |
| private bool isInstalling; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating wheter a game is being installed.. |
| /// Gets or sets value indicating wheter a game is being installed.. |
| /// </summary> |
| /// </summary> |
| public bool IsInstalling |
| public bool IsInstalling |
| { |
| { |
| get => isInstalling; |
| get => isInstalling; |
| set |
| set |
| { |
| { |
| isInstalling = value; |
| isInstalling = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool isUninstalling; |
| private bool isUninstalling; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating wheter a game is being uninstalled. |
| /// Gets or sets value indicating wheter a game is being uninstalled. |
| /// </summary> |
| /// </summary> |
| public bool IsUninstalling |
| public bool IsUninstalling |
| { |
| { |
| get => isUninstalling; |
| get => isUninstalling; |
| set |
| set |
| { |
| { |
| isUninstalling = value; |
| isUninstalling = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool isLaunching; |
| private bool isLaunching; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating wheter a game is being launched. |
| /// Gets or sets value indicating wheter a game is being launched. |
| /// </summary> |
| /// </summary> |
| public bool IsLaunching |
| public bool IsLaunching |
| { |
| { |
| get => isLaunching; |
| get => isLaunching; |
| set |
| set |
| { |
| { |
| isLaunching = value; |
| isLaunching = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool isRunning; |
| private bool isRunning; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating wheter a game is currently running. |
| /// Gets or sets value indicating wheter a game is currently running. |
| /// </summary> |
| /// </summary> |
| public bool IsRunning |
| public bool IsRunning |
| { |
| { |
| get => isRunning; |
| get => isRunning; |
| set |
| set |
| { |
| { |
| isRunning = value; |
| isRunning = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool isInstalled; |
| private bool isInstalled; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating wheter a game is installed. |
| /// Gets or sets value indicating wheter a game is installed. |
| /// </summary> |
| /// </summary> |
| public bool IsInstalled |
| public bool IsInstalled |
| { |
| { |
| get => isInstalled; |
| get => isInstalled; |
| set |
| set |
| { |
| { |
| isInstalled = value; |
| isInstalled = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(InstallationStatus)); |
| OnPropertyChanged(nameof(InstallationStatus)); |
| } |
| } |
| } |
| } |
| |
| |
. | private long playtime = 0; |
| private ulong playtime = 0; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets played time in seconds. |
| /// Gets or sets played time in seconds. |
| /// </summary> |
| /// </summary> |
. | public long Playtime |
| public ulong Playtime |
| { |
| { |
| get |
| get |
| { |
| { |
| return playtime; |
| return playtime; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| playtime = value; |
| playtime = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(PlaytimeCategory)); |
| OnPropertyChanged(nameof(PlaytimeCategory)); |
| } |
| } |
| } |
| } |
| |
| |
| private DateTime? added; |
| private DateTime? added; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets date when game was added into library. |
| /// Gets or sets date when game was added into library. |
| /// </summary> |
| /// </summary> |
| public DateTime? Added |
| public DateTime? Added |
| { |
| { |
| get |
| get |
| { |
| { |
| return added; |
| return added; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| added = value; |
| added = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(AddedSegment)); |
| OnPropertyChanged(nameof(AddedSegment)); |
| } |
| } |
| } |
| } |
| |
| |
| private DateTime? modified; |
| private DateTime? modified; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets date of last modification made to a game. |
| /// Gets or sets date of last modification made to a game. |
| /// </summary> |
| /// </summary> |
| public DateTime? Modified |
| public DateTime? Modified |
| { |
| { |
| get |
| get |
| { |
| { |
| return modified; |
| return modified; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| modified = value; |
| modified = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(ModifiedSegment)); |
| OnPropertyChanged(nameof(ModifiedSegment)); |
| } |
| } |
| } |
| } |
| |
| |
. | private long playCount = 0; |
| private ulong playCount = 0; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets a number indicating how many times the game has been played. |
| /// Gets or sets a number indicating how many times the game has been played. |
| /// </summary> |
| /// </summary> |
. | public long PlayCount |
| public ulong PlayCount |
| { |
| { |
| get |
| get |
| { |
| { |
| return playCount; |
| return playCount; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| playCount = value; |
| playCount = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | private Guid seriesId; |
| private List<Guid> seriesIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game series. |
| /// Gets or sets game series. |
| /// </summary> |
| /// </summary> |
. | public Guid SeriesId |
| public List<Guid> SeriesIds |
| { |
| { |
| get |
| get |
| { |
| { |
. | return seriesId; |
| return seriesIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | seriesId = value; |
| seriesIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Series)); |
| OnPropertyChanged(nameof(Series)); |
| } |
| } |
| } |
| } |
| |
| |
| private string version; |
| private string version; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game version. |
| /// Gets or sets game version. |
| /// </summary> |
| /// </summary> |
| public string Version |
| public string Version |
| { |
| { |
| get |
| get |
| { |
| { |
| return version; |
| return version; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| version = value; |
| version = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
. | private Guid ageRatingId; |
| private List<Guid> ageRatingIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets age rating for a game. |
| /// Gets or sets age rating for a game. |
| /// </summary> |
| /// </summary> |
. | public Guid AgeRatingId |
| public List<Guid> AgeRatingIds |
| { |
| { |
| get |
| get |
| { |
| { |
. | return ageRatingId; |
| return ageRatingIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | ageRatingId = value; |
| ageRatingIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
. | OnPropertyChanged(nameof(AgeRating)); |
| OnPropertyChanged(nameof(AgeRatings)); |
| } |
| } |
| } |
| } |
| |
| |
. | private Guid regionId; |
| private List<Guid> regionIds; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game region. |
| /// Gets or sets game region. |
| /// </summary> |
| /// </summary> |
. | public Guid RegionId |
| public List<Guid> RegionIds |
| { |
| { |
| get |
| get |
| { |
| { |
. | return regionId; |
| return regionIds; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | regionId = value; |
| regionIds = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
. | OnPropertyChanged(nameof(Region)); |
| OnPropertyChanged(nameof(Regions)); |
| } |
| } |
| } |
| } |
| |
| |
| private Guid sourceId; |
| private Guid sourceId; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets source of the game. |
| /// Gets or sets source of the game. |
| /// </summary> |
| /// </summary> |
| public Guid SourceId |
| public Guid SourceId |
| { |
| { |
| get |
| get |
| { |
| { |
| return sourceId; |
| return sourceId; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| sourceId = value; |
| sourceId = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(Source)); |
| OnPropertyChanged(nameof(Source)); |
| } |
| } |
| } |
| } |
| |
| |
. | private CompletionStatus completionStatus = CompletionStatus.NotPlayed; |
| private Guid completionStatusId; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game completion status. |
| /// Gets or sets game completion status. |
| /// </summary> |
| /// </summary> |
. | public CompletionStatus CompletionStatus |
| public Guid CompletionStatusId |
| { |
| { |
| get |
| get |
| { |
| { |
. | return completionStatus; |
| return completionStatusId; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
. | completionStatus = value; |
| completionStatusId = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
. | |
| OnPropertyChanged(nameof(CompletionStatus)); |
| } |
| } |
| } |
| } |
| |
| |
| private int? userScore = null; |
| private int? userScore = null; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets user's rating score. |
| /// Gets or sets user's rating score. |
| /// </summary> |
| /// </summary> |
| public int? UserScore |
| public int? UserScore |
| { |
| { |
| get |
| get |
| { |
| { |
| return userScore; |
| return userScore; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| userScore = value; |
| userScore = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(UserScoreGroup)); |
| OnPropertyChanged(nameof(UserScoreGroup)); |
| OnPropertyChanged(nameof(UserScoreRating)); |
| OnPropertyChanged(nameof(UserScoreRating)); |
| } |
| } |
| } |
| } |
| |
| |
| private int? criticScore = null; |
| private int? criticScore = null; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets critic based rating score. |
| /// Gets or sets critic based rating score. |
| /// </summary> |
| /// </summary> |
| public int? CriticScore |
| public int? CriticScore |
| { |
| { |
| get |
| get |
| { |
| { |
| return criticScore; |
| return criticScore; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| criticScore = value; |
| criticScore = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(CriticScoreGroup)); |
| OnPropertyChanged(nameof(CriticScoreGroup)); |
| OnPropertyChanged(nameof(CriticScoreRating)); |
| OnPropertyChanged(nameof(CriticScoreRating)); |
| } |
| } |
| } |
| } |
| |
| |
| private int? communityScore = null; |
| private int? communityScore = null; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets community rating score. |
| /// Gets or sets community rating score. |
| /// </summary> |
| /// </summary> |
| public int? CommunityScore |
| public int? CommunityScore |
| { |
| { |
| get |
| get |
| { |
| { |
| return communityScore; |
| return communityScore; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| communityScore = value; |
| communityScore = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| OnPropertyChanged(nameof(CommunityScoreGroup)); |
| OnPropertyChanged(nameof(CommunityScoreGroup)); |
| OnPropertyChanged(nameof(CommunityScoreRating)); |
| OnPropertyChanged(nameof(CommunityScoreRating)); |
| } |
| } |
| } |
| } |
| |
| |
. | private ScriptLanguage actionsScriptLanguage = ScriptLanguage.PowerShell; |
| |
| /// <summary> |
| |
| /// Gets or sets scripting language for <see cref="PreScript"/> and <see cref="PostScript"/> scripts. |
| |
| /// </summary> |
| |
| public ScriptLanguage ActionsScriptLanguage |
| |
| { |
| |
| get => actionsScriptLanguage; |
| |
| set |
| |
| { |
| |
| actionsScriptLanguage = value; |
| |
| OnPropertyChanged(); |
| |
| } |
| |
| } |
| |
| |
| |
| private string preScript; |
| private string preScript; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets pre-action script. |
| /// Gets or sets pre-action script. |
| /// </summary> |
| /// </summary> |
| [DefaultValue("")] |
| [DefaultValue("")] |
| public string PreScript |
| public string PreScript |
| { |
| { |
| get => preScript; |
| get => preScript; |
| set |
| set |
| { |
| { |
| preScript = value; |
| preScript = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string postScript; |
| private string postScript; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets post-action script. |
| /// Gets or sets post-action script. |
| /// </summary> |
| /// </summary> |
| [DefaultValue("")] |
| [DefaultValue("")] |
| public string PostScript |
| public string PostScript |
| { |
| { |
| get => postScript; |
| get => postScript; |
| set |
| set |
| { |
| { |
| postScript = value; |
| postScript = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string gameStartedScript; |
| private string gameStartedScript; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets script to be executed after game started. |
| /// Gets or sets script to be executed after game started. |
| /// </summary> |
| /// </summary> |
| [DefaultValue("")] |
| [DefaultValue("")] |
| public string GameStartedScript |
| public string GameStartedScript |
| { |
| { |
| get => gameStartedScript; |
| get => gameStartedScript; |
| set |
| set |
| { |
| { |
| gameStartedScript = value; |
| gameStartedScript = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool useGlobalPostScript = true; |
| private bool useGlobalPostScript = true; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating whether global post script should be executed. |
| /// Gets or sets value indicating whether global post script should be executed. |
| /// </summary> |
| /// </summary> |
| [DefaultValue(true)] |
| [DefaultValue(true)] |
| public bool UseGlobalPostScript |
| public bool UseGlobalPostScript |
| { |
| { |
| get => useGlobalPostScript; |
| get => useGlobalPostScript; |
| set |
| set |
| { |
| { |
| useGlobalPostScript = value; |
| useGlobalPostScript = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool useGlobalPreScript = true; |
| private bool useGlobalPreScript = true; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating whether global pre script should be executed. |
| /// Gets or sets value indicating whether global pre script should be executed. |
| /// </summary> |
| /// </summary> |
| [DefaultValue(true)] |
| [DefaultValue(true)] |
| public bool UseGlobalPreScript |
| public bool UseGlobalPreScript |
| { |
| { |
| get => useGlobalPreScript; |
| get => useGlobalPreScript; |
| set |
| set |
| { |
| { |
| useGlobalPreScript = value; |
| useGlobalPreScript = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private bool useGameStartedScript = true; |
| private bool useGameStartedScript = true; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets value indicating whether global pre script should be executed. |
| /// Gets or sets value indicating whether global pre script should be executed. |
| /// </summary> |
| /// </summary> |
| [DefaultValue(true)] |
| [DefaultValue(true)] |
| public bool UseGlobalGameStartedScript |
| public bool UseGlobalGameStartedScript |
| { |
| { |
| get => useGameStartedScript; |
| get => useGameStartedScript; |
| set |
| set |
| { |
| { |
| useGameStartedScript = value; |
| useGameStartedScript = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| private string manual; |
| private string manual; |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game manual. |
| /// Gets or sets game manual. |
| /// </summary> |
| /// </summary> |
| [DefaultValue("")] |
| [DefaultValue("")] |
| public string Manual |
| public string Manual |
| { |
| { |
| get |
| get |
| { |
| { |
| return manual; |
| return manual; |
| } |
| } |
| |
| |
| set |
| set |
| { |
| { |
| manual = value; |
| manual = value; |
| OnPropertyChanged(); |
| OnPropertyChanged(); |
| } |
| } |
| } |
| } |
| |
| |
| #region Expanded |
| #region Expanded |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's genres. |
| /// Gets game's genres. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public List<Genre> Genres |
| public List<Genre> Genres |
| { |
| { |
| get |
| get |
| { |
| { |
| if (genreIds?.Any() == true && DatabaseReference != null) |
| if (genreIds?.Any() == true && DatabaseReference != null) |
| { |
| { |
| return new List<Genre>(DatabaseReference?.Genres.Get(genreIds).OrderBy(a => a.Name)); |
| return new List<Genre>(DatabaseReference?.Genres.Get(genreIds).OrderBy(a => a.Name)); |
| } |
| } |
| |
| |
| return null; |
| return null; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's developers. |
| /// Gets game's developers. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public List<Company> Developers |
| public List<Company> Developers |
| { |
| { |
| get |
| get |
| { |
| { |
| if (developerIds?.Any() == true && DatabaseReference != null) |
| if (developerIds?.Any() == true && DatabaseReference != null) |
| { |
| { |
| return new List<Company>(DatabaseReference?.Companies.Get(developerIds).OrderBy(a => a.Name)); |
| return new List<Company>(DatabaseReference?.Companies.Get(developerIds).OrderBy(a => a.Name)); |
| } |
| } |
| |
| |
| return null; |
| return null; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's publishers. |
| /// Gets game's publishers. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public List<Company> Publishers |
| public List<Company> Publishers |
| { |
| { |
| get |
| get |
| { |
| { |
| if (publisherIds?.Any() == true && DatabaseReference != null) |
| if (publisherIds?.Any() == true && DatabaseReference != null) |
| { |
| { |
| return new List<Company>(DatabaseReference?.Companies.Get(publisherIds).OrderBy(a => a.Name)); |
| return new List<Company>(DatabaseReference?.Companies.Get(publisherIds).OrderBy(a => a.Name)); |
| } |
| } |
| |
| |
| return null; |
| return null; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's tags. |
| /// Gets game's tags. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public List<Tag> Tags |
| public List<Tag> Tags |
| { |
| { |
| get |
| get |
| { |
| { |
| if (tagIds?.Any() == true && DatabaseReference != null) |
| if (tagIds?.Any() == true && DatabaseReference != null) |
| { |
| { |
| return new List<Tag>(DatabaseReference?.Tags.Get(tagIds).OrderBy(a => a.Name)); |
| return new List<Tag>(DatabaseReference?.Tags.Get(tagIds).OrderBy(a => a.Name)); |
| } |
| } |
| |
| |
| return null; |
| return null; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's features. |
| /// Gets game's features. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public List<GameFeature> Features |
| public List<GameFeature> Features |
| { |
| { |
| get |
| get |
| { |
| { |
| if (featureIds?.Any() == true && DatabaseReference != null) |
| if (featureIds?.Any() == true && DatabaseReference != null) |
| { |
| { |
| return new List<GameFeature>(DatabaseReference?.Features.Get(featureIds).OrderBy(a => a.Name)); |
| return new List<GameFeature>(DatabaseReference?.Features.Get(featureIds).OrderBy(a => a.Name)); |
| } |
| } |
| |
| |
| return null; |
| return null; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's categories. |
| /// Gets game's categories. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public List<Category> Categories |
| public List<Category> Categories |
| { |
| { |
| get |
| get |
| { |
| { |
| if (categoryIds?.Any() == true && DatabaseReference != null) |
| if (categoryIds?.Any() == true && DatabaseReference != null) |
| { |
| { |
| return new List<Category>(DatabaseReference?.Categories.Get(categoryIds).OrderBy(a => a.Name)); |
| return new List<Category>(DatabaseReference?.Categories.Get(categoryIds).OrderBy(a => a.Name)); |
| } |
| } |
| |
| |
| return null; |
| return null; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's platform. |
| /// Gets game's platform. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public Platform Platform |
| public List<Platform> Platforms |
| { |
| { |
. | get => DatabaseReference?.Platforms[platformId]; |
| get |
| |
| { |
| |
| if (platformIds?.Any() == true && DatabaseReference != null) |
| |
| { |
| |
| return new List<Platform>(DatabaseReference?.Platforms.Get(platformIds).OrderBy(a => a.Name)); |
| |
| } |
| |
| |
| |
| return null; |
| |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's series. |
| /// Gets game's series. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public Series Series |
| public List<Series> Series |
| { |
| { |
. | get => DatabaseReference?.Series[seriesId]; |
| get |
| |
| { |
| |
| if (seriesIds?.Any() == true && DatabaseReference != null) |
| |
| { |
| |
| return new List<Series>(DatabaseReference?.Series.Get(seriesIds).OrderBy(a => a.Name)); |
| |
| } |
| |
| |
| |
| return null; |
| |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Get game's age rating. |
| /// Get game's age rating. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public AgeRating AgeRating |
| public List<AgeRating> AgeRatings |
| { |
| { |
. | get => DatabaseReference?.AgeRatings[ageRatingId]; |
| get |
| |
| { |
| |
| if (ageRatingIds?.Any() == true && DatabaseReference != null) |
| |
| { |
| |
| return new List<AgeRating>(DatabaseReference?.AgeRatings.Get(ageRatingIds).OrderBy(a => a.Name)); |
| |
| } |
| |
| |
| |
| return null; |
| |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's region. |
| /// Gets game's region. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public Region Region |
| public List<Region> Regions |
| { |
| { |
. | get => DatabaseReference?.Regions[regionId]; |
| get |
| |
| { |
| |
| if (regionIds?.Any() == true && DatabaseReference != null) |
| |
| { |
| |
| return new List<Region>(DatabaseReference?.Regions.Get(regionIds).OrderBy(a => a.Name)); |
| |
| } |
| |
| |
| |
| return null; |
| |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's source. |
| /// Gets game's source. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public GameSource Source |
| public GameSource Source |
| { |
| { |
| get => DatabaseReference?.Sources[sourceId]; |
| get => DatabaseReference?.Sources[sourceId]; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
. | |
| /// Gets game's completion status. |
| |
| /// </summary> |
| |
| [DontSerialize] |
| |
| public CompletionStatus CompletionStatus |
| |
| { |
| |
| get => DatabaseReference?.CompletionStatuses[completionStatusId]; |
| |
| } |
| |
| |
| |
| /// <summary> |
| /// Gets game's release year. |
| /// Gets game's release year. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public int? ReleaseYear |
| public int? ReleaseYear |
| { |
| { |
| get => ReleaseDate?.Year; |
| get => ReleaseDate?.Year; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's user score rating. |
| /// Gets game's user score rating. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public ScoreRating UserScoreRating |
| public ScoreRating UserScoreRating |
| { |
| { |
| get => GetScoreRating(UserScore); |
| get => GetScoreRating(UserScore); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's community score rating. |
| /// Gets game's community score rating. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public ScoreRating CommunityScoreRating |
| public ScoreRating CommunityScoreRating |
| { |
| { |
| get => GetScoreRating(CommunityScore); |
| get => GetScoreRating(CommunityScore); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's critic score rating. |
| /// Gets game's critic score rating. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public ScoreRating CriticScoreRating |
| public ScoreRating CriticScoreRating |
| { |
| { |
| get => GetScoreRating(CriticScore); |
| get => GetScoreRating(CriticScore); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's user score group. |
| /// Gets game's user score group. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public ScoreGroup UserScoreGroup |
| public ScoreGroup UserScoreGroup |
| { |
| { |
| get => GetScoreGroup(UserScore); |
| get => GetScoreGroup(UserScore); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's community score group. |
| /// Gets game's community score group. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public ScoreGroup CommunityScoreGroup |
| public ScoreGroup CommunityScoreGroup |
| { |
| { |
| get => GetScoreGroup(CommunityScore); |
| get => GetScoreGroup(CommunityScore); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's critic score group. |
| /// Gets game's critic score group. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public ScoreGroup CriticScoreGroup |
| public ScoreGroup CriticScoreGroup |
| { |
| { |
| get => GetScoreGroup(CriticScore); |
| get => GetScoreGroup(CriticScore); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets time segment for games last activity. |
| /// Gets time segment for games last activity. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public PastTimeSegment LastActivitySegment |
| public PastTimeSegment LastActivitySegment |
| { |
| { |
| get => GetPastTimeSegment(LastActivity); |
| get => GetPastTimeSegment(LastActivity); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets time segment for games added date. |
| /// Gets time segment for games added date. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public PastTimeSegment AddedSegment |
| public PastTimeSegment AddedSegment |
| { |
| { |
| get => GetPastTimeSegment(Added); |
| get => GetPastTimeSegment(Added); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets time segment for games modified date.. |
| /// Gets time segment for games modified date.. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public PastTimeSegment ModifiedSegment |
| public PastTimeSegment ModifiedSegment |
| { |
| { |
| get => GetPastTimeSegment(Modified); |
| get => GetPastTimeSegment(Modified); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game's play time category. |
| /// Gets game's play time category. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public PlaytimeCategory PlaytimeCategory |
| public PlaytimeCategory PlaytimeCategory |
| { |
| { |
| get => GetPlayTimeCategory(Playtime); |
| get => GetPlayTimeCategory(Playtime); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets value indicating wheter the game is custom game. |
| /// Gets value indicating wheter the game is custom game. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public bool IsCustomGame |
| public bool IsCustomGame |
| { |
| { |
| get => PluginId == Guid.Empty; |
| get => PluginId == Guid.Empty; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets game installation state. |
| /// Gets game installation state. |
| /// </summary> |
| /// </summary> |
. | [JsonIgnore] |
| [DontSerialize] |
| public InstallationStatus InstallationStatus |
| public InstallationStatus InstallationStatus |
| { |
| { |
| get => IsInstalled ? InstallationStatus.Installed : InstallationStatus.Uninstalled; |
| get => IsInstalled ? InstallationStatus.Installed : InstallationStatus.Uninstalled; |
| } |
| } |
| |
| |
| #endregion Expanded |
| #endregion Expanded |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets play time category. |
| /// Gets play time category. |
| /// </summary> |
| /// </summary> |
| /// <param name="seconds">Play time in seconds.</param> |
| /// <param name="seconds">Play time in seconds.</param> |
| /// <returns></returns> |
| /// <returns></returns> |
. | private PlaytimeCategory GetPlayTimeCategory(long seconds) |
| private PlaytimeCategory GetPlayTimeCategory(ulong seconds) |
| { |
| { |
| if (seconds == 0) |
| if (seconds == 0) |
| { |
| { |
| return PlaytimeCategory.NotPlayed; |
| return PlaytimeCategory.NotPlayed; |
| } |
| } |
| |
| |
| var hours = seconds / 3600; |
| var hours = seconds / 3600; |
| if (hours < 1) |
| if (hours < 1) |
| { |
| { |
| return PlaytimeCategory.LessThenHour; |
| return PlaytimeCategory.LessThenHour; |
| } |
| } |
| else if (hours >= 1 && hours <= 10) |
| else if (hours >= 1 && hours <= 10) |
| { |
| { |
| return PlaytimeCategory.O1_10; |
| return PlaytimeCategory.O1_10; |
| } |
| } |
| else if (hours >= 10 && hours <= 100) |
| else if (hours >= 10 && hours <= 100) |
| { |
| { |
| return PlaytimeCategory.O10_100; |
| return PlaytimeCategory.O10_100; |
| } |
| } |
| else if (hours >= 100 && hours <= 500) |
| else if (hours >= 100 && hours <= 500) |
| { |
| { |
| return PlaytimeCategory.O100_500; |
| return PlaytimeCategory.O100_500; |
| } |
| } |
| else if (hours >= 500 && hours <= 1000) |
| else if (hours >= 500 && hours <= 1000) |
| { |
| { |
| return PlaytimeCategory.O500_1000; |
| return PlaytimeCategory.O500_1000; |
| } |
| } |
| else |
| else |
| { |
| { |
| return PlaytimeCategory.O1000plus; |
| return PlaytimeCategory.O1000plus; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets time segment. |
| /// Gets time segment. |
| /// </summary> |
| /// </summary> |
| /// <param name="dateTime">Date time to be measured.</param> |
| /// <param name="dateTime">Date time to be measured.</param> |
| /// <returns></returns> |
| /// <returns></returns> |
| private PastTimeSegment GetPastTimeSegment(DateTime? dateTime) |
| private PastTimeSegment GetPastTimeSegment(DateTime? dateTime) |
| { |
| { |
| if (dateTime == null) |
| if (dateTime == null) |
| { |
| { |
| return PastTimeSegment.Never; |
| return PastTimeSegment.Never; |
| } |
| } |
| |
| |
| if (dateTime.Value.Date == DateTime.Today) |
| if (dateTime.Value.Date == DateTime.Today) |
| { |
| { |
| return PastTimeSegment.Today; |
| return PastTimeSegment.Today; |
| } |
| } |
| |
| |
| if (dateTime.Value.Date.AddDays(1) == DateTime.Today) |
| if (dateTime.Value.Date.AddDays(1) == DateTime.Today) |
| { |
| { |
| return PastTimeSegment.Yesterday; |
| return PastTimeSegment.Yesterday; |
| } |
| } |
| |
| |
| var diff = DateTime.Now - dateTime.Value; |
| var diff = DateTime.Now - dateTime.Value; |
| if (diff.TotalDays < 7) |
| if (diff.TotalDays < 7) |
| { |
| { |
| return PastTimeSegment.PastWeek; |
| return PastTimeSegment.PastWeek; |
| } |
| } |
| |
| |
| if (diff.TotalDays < 31) |
| if (diff.TotalDays < 31) |
| { |
| { |
| return PastTimeSegment.PastMonth; |
| return PastTimeSegment.PastMonth; |
| } |
| } |
| |
| |
| if (diff.TotalDays < 365) |
| if (diff.TotalDays < 365) |
| { |
| { |
| return PastTimeSegment.PastYear; |
| return PastTimeSegment.PastYear; |
| } |
| } |
| |
| |
| return PastTimeSegment.MoreThenYear; |
| return PastTimeSegment.MoreThenYear; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets score rating. |
| /// Gets score rating. |
| /// </summary> |
| /// </summary> |
| /// <param name="score">Score.</param> |
| /// <param name="score">Score.</param> |
| /// <returns></returns> |
| /// <returns></returns> |
| private ScoreRating GetScoreRating(int? score) |
| private ScoreRating GetScoreRating(int? score) |
| { |
| { |
| if (score == null) |
| if (score == null) |
| { |
| { |
| return ScoreRating.None; |
| return ScoreRating.None; |
| } |
| } |
| else if (score > 75) |
| else if (score > 75) |
| { |
| { |
| return ScoreRating.Positive; |
| return ScoreRating.Positive; |
| } |
| } |
| else if (score > 25) |
| else if (score > 25) |
| { |
| { |
| return ScoreRating.Mixed; |
| return ScoreRating.Mixed; |
| } |
| } |
| else |
| else |
| { |
| { |
| return ScoreRating.Negative; |
| return ScoreRating.Negative; |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets score group. |
| /// Gets score group. |
| /// </summary> |
| /// </summary> |
| /// <param name="score">Score.</param> |
| /// <param name="score">Score.</param> |
| /// <returns></returns> |
| /// <returns></returns> |
| private ScoreGroup GetScoreGroup(int? score) |
| private ScoreGroup GetScoreGroup(int? score) |
| { |
| { |
| if (score >= 0 && score < 10) |
| if (score >= 0 && score < 10) |
| { |
| { |
| return ScoreGroup.O0x; |
| return ScoreGroup.O0x; |
| } |
| } |
| |
| |
| if (score >= 10 && score < 20) |
| if (score >= 10 && score < 20) |
| { |
| { |
| return ScoreGroup.O1x; |
| return ScoreGroup.O1x; |
| } |
| } |
| |
| |
| if (score >= 20 && score < 30) |
| if (score >= 20 && score < 30) |
| { |
| { |
| return ScoreGroup.O2x; |
| return ScoreGroup.O2x; |
| } |
| } |
| |
| |
| if (score >= 30 && score < 40) |
| if (score >= 30 && score < 40) |
| { |
| { |
| return ScoreGroup.O3x; |
| return ScoreGroup.O3x; |
| } |
| } |
| |
| |
| if (score >= 40 && score < 50) |
| if (score >= 40 && score < 50) |
| { |
| { |
| return ScoreGroup.O4x; |
| return ScoreGroup.O4x; |
| } |
| } |
| |
| |
| if (score >= 50 && score < 60) |
| if (score >= 50 && score < 60) |
| { |
| { |
| return ScoreGroup.O5x; |
| return ScoreGroup.O5x; |
| } |
| } |
| |
| |
| if (score >= 60 && score < 70) |
| if (score >= 60 && score < 70) |
| { |
| { |
| return ScoreGroup.O6x; |
| return ScoreGroup.O6x; |
| } |
| } |
| |
| |
| if (score >= 70 && score < 80) |
| if (score >= 70 && score < 80) |
| { |
| { |
| return ScoreGroup.O7x; |
| return ScoreGroup.O7x; |
| } |
| } |
| |
| |
| if (score >= 80 && score < 90) |
| if (score >= 80 && score < 90) |
| { |
| { |
| return ScoreGroup.O8x; |
| return ScoreGroup.O8x; |
| } |
| } |
| |
| |
| if (score >= 90) |
| if (score >= 90) |
| { |
| { |
| return ScoreGroup.O9x; |
| return ScoreGroup.O9x; |
| } |
| } |
| |
| |
| return ScoreGroup.None; |
| return ScoreGroup.None; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets or sets game database reference. |
| /// Gets or sets game database reference. |
| /// </summary> |
| /// </summary> |
| internal static IGameDatabase DatabaseReference |
| internal static IGameDatabase DatabaseReference |
| { |
| { |
| get; set; |
| get; set; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Creates new instance of a Game object. |
| /// Creates new instance of a Game object. |
| /// </summary> |
| /// </summary> |
| public Game() : base() |
| public Game() : base() |
| { |
| { |
| GameId = Guid.NewGuid().ToString(); |
| GameId = Guid.NewGuid().ToString(); |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Creates new instance of a Game object with specific name. |
| /// Creates new instance of a Game object with specific name. |
| /// </summary> |
| /// </summary> |
| /// <param name="name">Game name.</param> |
| /// <param name="name">Game name.</param> |
| public Game(string name) : this() |
| public Game(string name) : this() |
| { |
| { |
| Name = name; |
| Name = name; |
| } |
| } |
| |
| |
| /// <inheritdoc/> |
| /// <inheritdoc/> |
| public override string ToString() |
| public override string ToString() |
| { |
| { |
| return Name; |
| return Name; |
| } |
| } |
| |
| |
| /// <inheritdoc/> |
| /// <inheritdoc/> |
| public override void CopyDiffTo(object target) |
| public override void CopyDiffTo(object target) |
| { |
| { |
| base.CopyDiffTo(target); |
| base.CopyDiffTo(target); |
| |
| |
| if (target is Game tro) |
| if (target is Game tro) |
| { |
| { |
| if (!string.Equals(BackgroundImage, tro.BackgroundImage, StringComparison.Ordinal)) |
| if (!string.Equals(BackgroundImage, tro.BackgroundImage, StringComparison.Ordinal)) |
| { |
| { |
| tro.BackgroundImage = BackgroundImage; |
| tro.BackgroundImage = BackgroundImage; |
| } |
| } |
| |
| |
| if (!string.Equals(Description, tro.Description, StringComparison.Ordinal)) |
| if (!string.Equals(Description, tro.Description, StringComparison.Ordinal)) |
| { |
| { |
| tro.Description = Description; |
| tro.Description = Description; |
| } |
| } |
| |
| |
| if (!string.Equals(Notes, tro.Notes, StringComparison.Ordinal)) |
| if (!string.Equals(Notes, tro.Notes, StringComparison.Ordinal)) |
| { |
| { |
| tro.Notes = Notes; |
| tro.Notes = Notes; |
| } |
| } |
| |
| |
| if (!GenreIds.IsListEqual(tro.GenreIds)) |
| if (!GenreIds.IsListEqual(tro.GenreIds)) |
| { |
| { |
| tro.GenreIds = GenreIds; |
| tro.GenreIds = GenreIds; |
| } |
| } |
| |
| |
| if (Hidden != tro.Hidden) |
| if (Hidden != tro.Hidden) |
| { |
| { |
| tro.Hidden = Hidden; |
| tro.Hidden = Hidden; |
| } |
| } |
| |
| |
| if (Favorite != tro.Favorite) |
| if (Favorite != tro.Favorite) |
| { |
| { |
| tro.Favorite = Favorite; |
| tro.Favorite = Favorite; |
| } |
| } |
| |
| |
| if (!string.Equals(Icon, tro.Icon, StringComparison.Ordinal)) |
| if (!string.Equals(Icon, tro.Icon, StringComparison.Ordinal)) |
| { |
| { |
| tro.Icon = Icon; |
| tro.Icon = Icon; |
| } |
| } |
| |
| |
| if (!string.Equals(CoverImage, tro.CoverImage, StringComparison.Ordinal)) |
| if (!string.Equals(CoverImage, tro.CoverImage, StringComparison.Ordinal)) |
| { |
| { |
| tro.CoverImage = CoverImage; |
| tro.CoverImage = CoverImage; |
| } |
| } |
| |
| |
| if (!string.Equals(InstallDirectory, tro.InstallDirectory, StringComparison.Ordinal)) |
| if (!string.Equals(InstallDirectory, tro.InstallDirectory, StringComparison.Ordinal)) |
| { |
| { |
| tro.InstallDirectory = InstallDirectory; |
| tro.InstallDirectory = InstallDirectory; |
| } |
| } |
| |
| |
. | if (!string.Equals(GameImagePath, tro.GameImagePath, StringComparison.Ordinal)) |
| |
| { |
| |
| tro.GameImagePath = GameImagePath; |
| |
| } |
| |
| |
| |
| if (LastActivity != tro.LastActivity) |
| if (LastActivity != tro.LastActivity) |
| { |
| { |
| tro.LastActivity = LastActivity; |
| tro.LastActivity = LastActivity; |
| } |
| } |
| |
| |
| if (!string.Equals(SortingName, tro.SortingName, StringComparison.Ordinal)) |
| if (!string.Equals(SortingName, tro.SortingName, StringComparison.Ordinal)) |
| { |
| { |
| tro.SortingName = SortingName; |
| tro.SortingName = SortingName; |
| } |
| } |
| |
| |
| if (!string.Equals(GameId, tro.GameId, StringComparison.Ordinal)) |
| if (!string.Equals(GameId, tro.GameId, StringComparison.Ordinal)) |
| { |
| { |
| tro.GameId = GameId; |
| tro.GameId = GameId; |
| } |
| } |
| |
| |
| if (PluginId != tro.PluginId) |
| if (PluginId != tro.PluginId) |
| { |
| { |
| tro.PluginId = PluginId; |
| tro.PluginId = PluginId; |
| } |
| } |
| |
| |
. | if (!OtherActions.IsListEqualExact(tro.OtherActions)) |
| if (!GameActions.IsListEqualExact(tro.GameActions)) |
| { |
| |
| tro.OtherActions = OtherActions; |
| |
| } |
| |
| |
| |
| if (!GameAction.Equals(PlayAction, tro.PlayAction)) |
| |
| { |
| { |
. | tro.PlayAction = PlayAction; |
| tro.GameActions = GameActions; |
| } |
| } |
| |
| |
. | if (PlatformId != tro.PlatformId) |
| if (!PlatformIds.IsListEqual(tro.PlatformIds)) |
| { |
| { |
. | tro.PlatformId = PlatformId; |
| tro.PlatformIds = PlatformIds; |
| } |
| } |
| |
| |
| if (!PublisherIds.IsListEqual(tro.PublisherIds)) |
| if (!PublisherIds.IsListEqual(tro.PublisherIds)) |
| { |
| { |
| tro.PublisherIds = PublisherIds; |
| tro.PublisherIds = PublisherIds; |
| } |
| } |
| |
| |
| if (!DeveloperIds.IsListEqual(tro.DeveloperIds)) |
| if (!DeveloperIds.IsListEqual(tro.DeveloperIds)) |
| { |
| { |
| tro.DeveloperIds = DeveloperIds; |
| tro.DeveloperIds = DeveloperIds; |
| } |
| } |
| |
| |
| if (ReleaseDate != tro.ReleaseDate) |
| if (ReleaseDate != tro.ReleaseDate) |
| { |
| { |
| tro.ReleaseDate = ReleaseDate; |
| tro.ReleaseDate = ReleaseDate; |
| } |
| } |
| |
| |
| if (!CategoryIds.IsListEqual(tro.CategoryIds)) |
| if (!CategoryIds.IsListEqual(tro.CategoryIds)) |
| { |
| { |
| tro.CategoryIds = CategoryIds; |
| tro.CategoryIds = CategoryIds; |
| } |
| } |
| |
| |
| if (!TagIds.IsListEqual(tro.TagIds)) |
| if (!TagIds.IsListEqual(tro.TagIds)) |
| { |
| { |
| tro.TagIds = TagIds; |
| tro.TagIds = TagIds; |
| } |
| } |
| |
| |
| if (!FeatureIds.IsListEqual(tro.FeatureIds)) |
| if (!FeatureIds.IsListEqual(tro.FeatureIds)) |
| { |
| { |
| tro.FeatureIds = FeatureIds; |
| tro.FeatureIds = FeatureIds; |
| } |
| } |
| |
| |
| if (!Links.IsListEqualExact(tro.Links)) |
| if (!Links.IsListEqualExact(tro.Links)) |
| { |
| { |
| tro.Links = Links; |
| tro.Links = Links; |
| } |
| } |
| |
| |
. | |
| if (!Roms.IsListEqualExact(tro.Roms)) |
| |
| { |
| |
| tro.Roms = Roms; |
| |
| } |
| |
| |
| if (IsInstalling != tro.IsInstalling) |
| if (IsInstalling != tro.IsInstalling) |
| { |
| { |
| tro.IsInstalling = IsInstalling; |
| tro.IsInstalling = IsInstalling; |
| } |
| } |
| |
| |
| if (IsUninstalling != tro.IsUninstalling) |
| if (IsUninstalling != tro.IsUninstalling) |
| { |
| { |
| tro.IsUninstalling = IsUninstalling; |
| tro.IsUninstalling = IsUninstalling; |
| } |
| } |
| |
| |
| if (IsLaunching != tro.IsLaunching) |
| if (IsLaunching != tro.IsLaunching) |
| { |
| { |
| tro.IsLaunching = IsLaunching; |
| tro.IsLaunching = IsLaunching; |
| } |
| } |
| |
| |
| if (IsRunning != tro.IsRunning) |
| if (IsRunning != tro.IsRunning) |
| { |
| { |
| tro.IsRunning = IsRunning; |
| tro.IsRunning = IsRunning; |
| } |
| } |
| |
| |
| if (IsInstalled != tro.IsInstalled) |
| if (IsInstalled != tro.IsInstalled) |
| { |
| { |
| tro.IsInstalled = IsInstalled; |
| tro.IsInstalled = IsInstalled; |
| } |
| } |
| |
| |
| if (Playtime != tro.Playtime) |
| if (Playtime != tro.Playtime) |
| { |
| { |
| tro.Playtime = Playtime; |
| tro.Playtime = Playtime; |
| } |
| } |
| |
| |
| if (Added != tro.Added) |
| if (Added != tro.Added) |
| { |
| { |
| tro.Added = Added; |
| tro.Added = Added; |
| } |
| } |
| |
| |
| if (Modified != tro.Modified) |
| if (Modified != tro.Modified) |
| { |
| { |
| tro.Modified = Modified; |
| tro.Modified = Modified; |
| } |
| } |
| |
| |
| if (PlayCount != tro.PlayCount) |
| if (PlayCount != tro.PlayCount) |
| { |
| { |
| tro.PlayCount = PlayCount; |
| tro.PlayCount = PlayCount; |
| } |
| } |
| |
| |
. | if (SeriesId != tro.SeriesId) |
| if (!SeriesIds.IsListEqual(tro.SeriesIds)) |
| { |
| { |
. | tro.SeriesId = SeriesId; |
| tro.SeriesIds = SeriesIds; |
| } |
| } |
| |
| |
| if (Version != tro.Version) |
| if (Version != tro.Version) |
| { |
| { |
| tro.Version = Version; |
| tro.Version = Version; |
| } |
| } |
| |
| |
. | if (AgeRatingId != tro.AgeRatingId) |
| if (!AgeRatingIds.IsListEqual(tro.AgeRatingIds)) |
| { |
| { |
. | tro.AgeRatingId = AgeRatingId; |
| tro.AgeRatingIds = AgeRatingIds; |
| } |
| } |
| |
| |
. | if (RegionId != tro.RegionId) |
| if (!RegionIds.IsListEqual(tro.RegionIds)) |
| { |
| { |
. | tro.RegionId = RegionId; |
| tro.RegionIds = RegionIds; |
| } |
| } |
| |
| |
| if (SourceId != tro.SourceId) |
| if (SourceId != tro.SourceId) |
| { |
| { |
| tro.SourceId = SourceId; |
| tro.SourceId = SourceId; |
| } |
| } |
| |
| |
. | if (CompletionStatus != tro.CompletionStatus) |
| if (CompletionStatusId != tro.CompletionStatusId) |
| { |
| { |
. | tro.CompletionStatus = CompletionStatus; |
| tro.CompletionStatusId = CompletionStatusId; |
| } |
| } |
| |
| |
| if (UserScore != tro.UserScore) |
| if (UserScore != tro.UserScore) |
| { |
| { |
| tro.UserScore = UserScore; |
| tro.UserScore = UserScore; |
| } |
| } |
| |
| |
| if (CriticScore != tro.CriticScore) |
| if (CriticScore != tro.CriticScore) |
| { |
| { |
| tro.CriticScore = CriticScore; |
| tro.CriticScore = CriticScore; |
| } |
| } |
| |
| |
| if (CommunityScore != tro.CommunityScore) |
| if (CommunityScore != tro.CommunityScore) |
| { |
| { |
| tro.CommunityScore = CommunityScore; |
| tro.CommunityScore = CommunityScore; |
| } |
| } |
| |
| |
| if (!string.Equals(PreScript, tro.PreScript, StringComparison.Ordinal)) |
| if (!string.Equals(PreScript, tro.PreScript, StringComparison.Ordinal)) |
| { |
| { |
| tro.PreScript = PreScript; |
| tro.PreScript = PreScript; |
| } |
| } |
| |
| |
| if (!string.Equals(PostScript, tro.PostScript, StringComparison.Ordinal)) |
| if (!string.Equals(PostScript, tro.PostScript, StringComparison.Ordinal)) |
| { |
| { |
| tro.PostScript = PostScript; |
| tro.PostScript = PostScript; |
| } |
| } |
| |
| |
| if (!string.Equals(GameStartedScript, tro.GameStartedScript, StringComparison.Ordinal)) |
| if (!string.Equals(GameStartedScript, tro.GameStartedScript, StringComparison.Ordinal)) |
| { |
| { |
| tro.GameStartedScript = GameStartedScript; |
| tro.GameStartedScript = GameStartedScript; |
| } |
| } |
| |
| |
. | if (ActionsScriptLanguage != tro.ActionsScriptLanguage) |
| |
| { |
| |
| tro.ActionsScriptLanguage = ActionsScriptLanguage; |
| |
| } |
| |
| |
| |
| if (UseGlobalPostScript != tro.UseGlobalPostScript) |
| if (UseGlobalPostScript != tro.UseGlobalPostScript) |
| { |
| { |
| tro.UseGlobalPostScript = UseGlobalPostScript; |
| tro.UseGlobalPostScript = UseGlobalPostScript; |
| } |
| } |
| |
| |
| if (UseGlobalPreScript != tro.UseGlobalPreScript) |
| if (UseGlobalPreScript != tro.UseGlobalPreScript) |
| { |
| { |
| tro.UseGlobalPreScript = UseGlobalPreScript; |
| tro.UseGlobalPreScript = UseGlobalPreScript; |
| } |
| } |
| |
| |
| if (UseGlobalGameStartedScript != tro.UseGlobalGameStartedScript) |
| if (UseGlobalGameStartedScript != tro.UseGlobalGameStartedScript) |
| { |
| { |
| tro.UseGlobalGameStartedScript = UseGlobalGameStartedScript; |
| tro.UseGlobalGameStartedScript = UseGlobalGameStartedScript; |
| } |
| } |
| |
| |
| if (!string.Equals(Manual, tro.Manual, StringComparison.Ordinal)) |
| if (!string.Equals(Manual, tro.Manual, StringComparison.Ordinal)) |
| { |
| { |
| tro.Manual = Manual; |
| tro.Manual = Manual; |
| } |
| } |
. | |
| |
| |
| if (IncludeLibraryPluginAction != tro.IncludeLibraryPluginAction) |
| |
| { |
| |
| tro.IncludeLibraryPluginAction = IncludeLibraryPluginAction; |
| |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| throw new ArgumentException($"Target object has to be of type {GetType().Name}"); |
| throw new ArgumentException($"Target object has to be of type {GetType().Name}"); |
| } |
| } |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Get differecens in game objects. |
| /// Get differecens in game objects. |
| /// </summary> |
| /// </summary> |
| /// <param name="otherGame">Game object to compare to.</param> |
| /// <param name="otherGame">Game object to compare to.</param> |
| /// <returns>List of field that differ.</returns> |
| /// <returns>List of field that differ.</returns> |
| public List<GameField> GetDifferences(Game otherGame) |
| public List<GameField> GetDifferences(Game otherGame) |
| { |
| { |
| var changes = new List<GameField>(); |
| var changes = new List<GameField>(); |
| if (!string.Equals(BackgroundImage, otherGame.BackgroundImage, StringComparison.Ordinal)) |
| if (!string.Equals(BackgroundImage, otherGame.BackgroundImage, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.BackgroundImage); |
| changes.Add(GameField.BackgroundImage); |
| } |
| } |
| |
| |
| if (!string.Equals(Description, otherGame.Description, StringComparison.Ordinal)) |
| if (!string.Equals(Description, otherGame.Description, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.Description); |
| changes.Add(GameField.Description); |
| } |
| } |
| |
| |
| if (!string.Equals(Notes, otherGame.Notes, StringComparison.Ordinal)) |
| if (!string.Equals(Notes, otherGame.Notes, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.Notes); |
| changes.Add(GameField.Notes); |
| } |
| } |
| |
| |
| if (!GenreIds.IsListEqual(otherGame.GenreIds)) |
| if (!GenreIds.IsListEqual(otherGame.GenreIds)) |
| { |
| { |
| changes.Add(GameField.GenreIds); |
| changes.Add(GameField.GenreIds); |
| changes.Add(GameField.Genres); |
| changes.Add(GameField.Genres); |
| } |
| } |
| |
| |
| if (Hidden != otherGame.Hidden) |
| if (Hidden != otherGame.Hidden) |
| { |
| { |
| changes.Add(GameField.Hidden); |
| changes.Add(GameField.Hidden); |
| } |
| } |
| |
| |
| if (Favorite != otherGame.Favorite) |
| if (Favorite != otherGame.Favorite) |
| { |
| { |
| changes.Add(GameField.Favorite); |
| changes.Add(GameField.Favorite); |
| } |
| } |
| |
| |
| if (!string.Equals(Icon, otherGame.Icon, StringComparison.Ordinal)) |
| if (!string.Equals(Icon, otherGame.Icon, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.Icon); |
| changes.Add(GameField.Icon); |
| } |
| } |
| |
| |
| if (!string.Equals(CoverImage, otherGame.CoverImage, StringComparison.Ordinal)) |
| if (!string.Equals(CoverImage, otherGame.CoverImage, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.CoverImage); |
| changes.Add(GameField.CoverImage); |
| } |
| } |
| |
| |
| if (!string.Equals(InstallDirectory, otherGame.InstallDirectory, StringComparison.Ordinal)) |
| if (!string.Equals(InstallDirectory, otherGame.InstallDirectory, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.InstallDirectory); |
| changes.Add(GameField.InstallDirectory); |
| } |
| } |
| |
| |
. | if (!string.Equals(GameImagePath, otherGame.GameImagePath, StringComparison.Ordinal)) |
| |
| { |
| |
| changes.Add(GameField.GameImagePath); |
| |
| } |
| |
| |
| |
| if (LastActivity != otherGame.LastActivity) |
| if (LastActivity != otherGame.LastActivity) |
| { |
| { |
| changes.Add(GameField.LastActivity); |
| changes.Add(GameField.LastActivity); |
| if (LastActivitySegment != otherGame.LastActivitySegment) |
| if (LastActivitySegment != otherGame.LastActivitySegment) |
| { |
| { |
| changes.Add(GameField.LastActivitySegment); |
| changes.Add(GameField.LastActivitySegment); |
| } |
| } |
| } |
| } |
| |
| |
| if (!string.Equals(SortingName, otherGame.SortingName, StringComparison.Ordinal)) |
| if (!string.Equals(SortingName, otherGame.SortingName, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.SortingName); |
| changes.Add(GameField.SortingName); |
| } |
| } |
| |
| |
| if (!string.Equals(GameId, otherGame.GameId, StringComparison.Ordinal)) |
| if (!string.Equals(GameId, otherGame.GameId, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.Gameid); |
| changes.Add(GameField.Gameid); |
| } |
| } |
| |
| |
| if (PluginId != otherGame.PluginId) |
| if (PluginId != otherGame.PluginId) |
| { |
| { |
| changes.Add(GameField.PluginId); |
| changes.Add(GameField.PluginId); |
| } |
| } |
| |
| |
. | if (!OtherActions.IsListEqualExact(otherGame.OtherActions)) |
| if (!GameActions.IsListEqualExact(otherGame.GameActions)) |
| { |
| |
| changes.Add(GameField.OtherActions); |
| |
| } |
| |
| |
| |
| if (!GameAction.Equals(PlayAction, otherGame.PlayAction)) |
| |
| { |
| { |
. | changes.Add(GameField.PlayAction); |
| changes.Add(GameField.GameActions); |
| } |
| } |
| |
| |
. | if (PlatformId != otherGame.PlatformId) |
| if (!PlatformIds.IsListEqual(otherGame.PlatformIds)) |
| { |
| { |
. | changes.Add(GameField.PlatformId); |
| changes.Add(GameField.PlatformIds); |
| changes.Add(GameField.Platform); |
| changes.Add(GameField.Platforms); |
| } |
| } |
| |
| |
| if (!PublisherIds.IsListEqual(otherGame.PublisherIds)) |
| if (!PublisherIds.IsListEqual(otherGame.PublisherIds)) |
| { |
| { |
| changes.Add(GameField.PublisherIds); |
| changes.Add(GameField.PublisherIds); |
| changes.Add(GameField.Publishers); |
| changes.Add(GameField.Publishers); |
| } |
| } |
| |
| |
| if (!DeveloperIds.IsListEqual(otherGame.DeveloperIds)) |
| if (!DeveloperIds.IsListEqual(otherGame.DeveloperIds)) |
| { |
| { |
| changes.Add(GameField.DeveloperIds); |
| changes.Add(GameField.DeveloperIds); |
| changes.Add(GameField.Developers); |
| changes.Add(GameField.Developers); |
| } |
| } |
| |
| |
| if (ReleaseDate != otherGame.ReleaseDate) |
| if (ReleaseDate != otherGame.ReleaseDate) |
| { |
| { |
| changes.Add(GameField.ReleaseDate); |
| changes.Add(GameField.ReleaseDate); |
| if (ReleaseYear != otherGame.ReleaseYear) |
| if (ReleaseYear != otherGame.ReleaseYear) |
| { |
| { |
| changes.Add(GameField.ReleaseYear); |
| changes.Add(GameField.ReleaseYear); |
| } |
| } |
| } |
| } |
| |
| |
| if (!CategoryIds.IsListEqual(otherGame.CategoryIds)) |
| if (!CategoryIds.IsListEqual(otherGame.CategoryIds)) |
| { |
| { |
| changes.Add(GameField.CategoryIds); |
| changes.Add(GameField.CategoryIds); |
| changes.Add(GameField.Categories); |
| changes.Add(GameField.Categories); |
| } |
| } |
| |
| |
| if (!TagIds.IsListEqual(otherGame.TagIds)) |
| if (!TagIds.IsListEqual(otherGame.TagIds)) |
| { |
| { |
| changes.Add(GameField.TagIds); |
| changes.Add(GameField.TagIds); |
| changes.Add(GameField.Tags); |
| changes.Add(GameField.Tags); |
| } |
| } |
| |
| |
| if (!FeatureIds.IsListEqual(otherGame.FeatureIds)) |
| if (!FeatureIds.IsListEqual(otherGame.FeatureIds)) |
| { |
| { |
| changes.Add(GameField.FeatureIds); |
| changes.Add(GameField.FeatureIds); |
| changes.Add(GameField.Features); |
| changes.Add(GameField.Features); |
| } |
| } |
| |
| |
| if (!Links.IsListEqualExact(otherGame.Links)) |
| if (!Links.IsListEqualExact(otherGame.Links)) |
| { |
| { |
| changes.Add(GameField.Links); |
| changes.Add(GameField.Links); |
| } |
| } |
| |
| |
. | |
| if (!Roms.IsListEqualExact(otherGame.Roms)) |
| |
| { |
| |
| changes.Add(GameField.Roms); |
| |
| } |
| |
| |
| if (IsInstalling != otherGame.IsInstalling) |
| if (IsInstalling != otherGame.IsInstalling) |
| { |
| { |
| changes.Add(GameField.IsInstalling); |
| changes.Add(GameField.IsInstalling); |
| } |
| } |
| |
| |
| if (IsUninstalling != otherGame.IsUninstalling) |
| if (IsUninstalling != otherGame.IsUninstalling) |
| { |
| { |
| changes.Add(GameField.IsUninstalling); |
| changes.Add(GameField.IsUninstalling); |
| } |
| } |
| |
| |
| if (IsLaunching != otherGame.IsLaunching) |
| if (IsLaunching != otherGame.IsLaunching) |
| { |
| { |
| changes.Add(GameField.IsLaunching); |
| changes.Add(GameField.IsLaunching); |
| } |
| } |
| |
| |
| if (IsRunning != otherGame.IsRunning) |
| if (IsRunning != otherGame.IsRunning) |
| { |
| { |
| changes.Add(GameField.IsRunning); |
| changes.Add(GameField.IsRunning); |
| } |
| } |
| |
| |
| if (IsInstalled != otherGame.IsInstalled) |
| if (IsInstalled != otherGame.IsInstalled) |
| { |
| { |
| changes.Add(GameField.IsInstalled); |
| changes.Add(GameField.IsInstalled); |
| changes.Add(GameField.InstallationStatus); |
| changes.Add(GameField.InstallationStatus); |
| } |
| } |
| |
| |
| if (Playtime != otherGame.Playtime) |
| if (Playtime != otherGame.Playtime) |
| { |
| { |
| changes.Add(GameField.Playtime); |
| changes.Add(GameField.Playtime); |
| if (PlaytimeCategory != otherGame.PlaytimeCategory) |
| if (PlaytimeCategory != otherGame.PlaytimeCategory) |
| { |
| { |
| changes.Add(GameField.PlaytimeCategory); |
| changes.Add(GameField.PlaytimeCategory); |
| } |
| } |
| } |
| } |
| |
| |
| if (Added != otherGame.Added) |
| if (Added != otherGame.Added) |
| { |
| { |
| changes.Add(GameField.Added); |
| changes.Add(GameField.Added); |
| if (AddedSegment != otherGame.AddedSegment) |
| if (AddedSegment != otherGame.AddedSegment) |
| { |
| { |
| changes.Add(GameField.AddedSegment); |
| changes.Add(GameField.AddedSegment); |
| } |
| } |
| } |
| } |
| |
| |
| if (Modified != otherGame.Modified) |
| if (Modified != otherGame.Modified) |
| { |
| { |
| changes.Add(GameField.Modified); |
| changes.Add(GameField.Modified); |
| if (Modified != otherGame.Modified) |
| if (Modified != otherGame.Modified) |
| { |
| { |
| changes.Add(GameField.ModifiedSegment); |
| changes.Add(GameField.ModifiedSegment); |
| } |
| } |
| } |
| } |
| |
| |
| if (PlayCount != otherGame.PlayCount) |
| if (PlayCount != otherGame.PlayCount) |
| { |
| { |
| changes.Add(GameField.PlayCount); |
| changes.Add(GameField.PlayCount); |
| } |
| } |
| |
| |
. | if (SeriesId != otherGame.SeriesId) |
| if (!SeriesIds.IsListEqual(otherGame.SeriesIds)) |
| { |
| { |
. | changes.Add(GameField.SeriesId); |
| changes.Add(GameField.SeriesIds); |
| changes.Add(GameField.Series); |
| changes.Add(GameField.Series); |
| } |
| } |
| |
| |
| if (Version != otherGame.Version) |
| if (Version != otherGame.Version) |
| { |
| { |
| changes.Add(GameField.Version); |
| changes.Add(GameField.Version); |
| } |
| } |
| |
| |
. | if (AgeRatingId != otherGame.AgeRatingId) |
| if (!AgeRatingIds.IsListEqual(otherGame.AgeRatingIds)) |
| { |
| { |
. | changes.Add(GameField.AgeRatingId); |
| changes.Add(GameField.AgeRatingIds); |
| changes.Add(GameField.AgeRating); |
| changes.Add(GameField.AgeRatings); |
| } |
| } |
| |
| |
. | if (RegionId != otherGame.RegionId) |
| if (!RegionIds.IsListEqual(otherGame.RegionIds)) |
| { |
| { |
. | changes.Add(GameField.RegionId); |
| changes.Add(GameField.RegionIds); |
| changes.Add(GameField.Region); |
| changes.Add(GameField.Regions); |
| } |
| } |
| |
| |
| if (SourceId != otherGame.SourceId) |
| if (SourceId != otherGame.SourceId) |
| { |
| { |
| changes.Add(GameField.SourceId); |
| changes.Add(GameField.SourceId); |
| changes.Add(GameField.Source); |
| changes.Add(GameField.Source); |
| } |
| } |
| |
| |
. | if (CompletionStatus != otherGame.CompletionStatus) |
| if (CompletionStatusId != otherGame.CompletionStatusId) |
| { |
| { |
. | |
| changes.Add(GameField.CompletionStatusId); |
| changes.Add(GameField.CompletionStatus); |
| changes.Add(GameField.CompletionStatus); |
| } |
| } |
| |
| |
| if (UserScore != otherGame.UserScore) |
| if (UserScore != otherGame.UserScore) |
| { |
| { |
| changes.Add(GameField.UserScore); |
| changes.Add(GameField.UserScore); |
| if (UserScoreGroup != otherGame.UserScoreGroup) |
| if (UserScoreGroup != otherGame.UserScoreGroup) |
| { |
| { |
| changes.Add(GameField.UserScoreGroup); |
| changes.Add(GameField.UserScoreGroup); |
| } |
| } |
| |
| |
| if (UserScoreRating != otherGame.UserScoreRating) |
| if (UserScoreRating != otherGame.UserScoreRating) |
| { |
| { |
| changes.Add(GameField.UserScoreRating); |
| changes.Add(GameField.UserScoreRating); |
| } |
| } |
| } |
| } |
| |
| |
| if (CriticScore != otherGame.CriticScore) |
| if (CriticScore != otherGame.CriticScore) |
| { |
| { |
| changes.Add(GameField.CriticScore); |
| changes.Add(GameField.CriticScore); |
| if (CriticScoreGroup != otherGame.CriticScoreGroup) |
| if (CriticScoreGroup != otherGame.CriticScoreGroup) |
| { |
| { |
| changes.Add(GameField.CriticScoreGroup); |
| changes.Add(GameField.CriticScoreGroup); |
| } |
| } |
| |
| |
| if (CriticScoreRating != otherGame.CriticScoreRating) |
| if (CriticScoreRating != otherGame.CriticScoreRating) |
| { |
| { |
| changes.Add(GameField.CriticScoreRating); |
| changes.Add(GameField.CriticScoreRating); |
| } |
| } |
| } |
| } |
| |
| |
| if (CommunityScore != otherGame.CommunityScore) |
| if (CommunityScore != otherGame.CommunityScore) |
| { |
| { |
| changes.Add(GameField.CommunityScore); |
| changes.Add(GameField.CommunityScore); |
| if (CommunityScoreGroup != otherGame.CommunityScoreGroup) |
| if (CommunityScoreGroup != otherGame.CommunityScoreGroup) |
| { |
| { |
| changes.Add(GameField.CommunityScoreGroup); |
| changes.Add(GameField.CommunityScoreGroup); |
| } |
| } |
| |
| |
| if (CommunityScoreRating != otherGame.CommunityScoreRating) |
| if (CommunityScoreRating != otherGame.CommunityScoreRating) |
| { |
| { |
| changes.Add(GameField.CommunityScoreRating); |
| changes.Add(GameField.CommunityScoreRating); |
| } |
| } |
| } |
| } |
| |
| |
| if (!string.Equals(PreScript, otherGame.PreScript, StringComparison.Ordinal)) |
| if (!string.Equals(PreScript, otherGame.PreScript, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.PreScript); |
| changes.Add(GameField.PreScript); |
| } |
| } |
| |
| |
| if (!string.Equals(PostScript, otherGame.PostScript, StringComparison.Ordinal)) |
| if (!string.Equals(PostScript, otherGame.PostScript, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.PostScript); |
| changes.Add(GameField.PostScript); |
| } |
| } |
| |
| |
| if (!string.Equals(GameStartedScript, otherGame.GameStartedScript, StringComparison.Ordinal)) |
| if (!string.Equals(GameStartedScript, otherGame.GameStartedScript, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.GameStartedScript); |
| changes.Add(GameField.GameStartedScript); |
| } |
| } |
| |
| |
. | if (ActionsScriptLanguage != otherGame.ActionsScriptLanguage) |
| |
| { |
| |
| changes.Add(GameField.ActionsScriptLanguage); |
| |
| } |
| |
| |
| |
| if (UseGlobalPostScript != otherGame.UseGlobalPostScript) |
| if (UseGlobalPostScript != otherGame.UseGlobalPostScript) |
| { |
| { |
| changes.Add(GameField.UseGlobalPostScript); |
| changes.Add(GameField.UseGlobalPostScript); |
| } |
| } |
| |
| |
| if (UseGlobalPreScript != otherGame.UseGlobalPreScript) |
| if (UseGlobalPreScript != otherGame.UseGlobalPreScript) |
| { |
| { |
| changes.Add(GameField.UseGlobalPreScript); |
| changes.Add(GameField.UseGlobalPreScript); |
| } |
| } |
| |
| |
| if (UseGlobalGameStartedScript != otherGame.UseGlobalGameStartedScript) |
| if (UseGlobalGameStartedScript != otherGame.UseGlobalGameStartedScript) |
| { |
| { |
| changes.Add(GameField.UseGlobalGameStartedScript); |
| changes.Add(GameField.UseGlobalGameStartedScript); |
| } |
| } |
| |
| |
| if (!string.Equals(Manual, otherGame.Manual, StringComparison.Ordinal)) |
| if (!string.Equals(Manual, otherGame.Manual, StringComparison.Ordinal)) |
| { |
| { |
| changes.Add(GameField.Manual); |
| changes.Add(GameField.Manual); |
| } |
| } |
| |
| |
. | |
| if (IncludeLibraryPluginAction != otherGame.IncludeLibraryPluginAction) |
| |
| { |
| |
| changes.Add(GameField.IncludeLibraryPluginAction); |
| |
| } |
| |
| |
| return changes; |
| return changes; |
. | |
| } |
| |
| |
| |
| /// <summary> |
| |
| /// |
| |
| /// </summary> |
| |
| /// <returns></returns> |
| |
| public char GetNameGroup() |
| |
| { |
| |
| var nameMatch = string.IsNullOrEmpty(SortingName) ? Name : SortingName; |
| |
| if (string.IsNullOrEmpty(nameMatch)) |
| |
| { |
| |
| return '#'; |
| |
| } |
| |
| else |
| |
| { |
| |
| var firstChar = char.ToUpper(nameMatch[0]); |
| |
| return char.IsLetter(firstChar) ? firstChar : '#'; |
| |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |