
* Saved game icon now displays on game cover art in library * Fixed casing error on save state download icon * Migrate EJS from submodule to 7z download during docker build * Updated README and gitignore * Resized library search buttons * Export to JSON now triggers the download rather than display of a formatted platform map
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System.Reflection;
|
|
using gaseous_server.Classes;
|
|
using gaseous_server.Classes.Metadata;
|
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
|
|
|
namespace gaseous_server.Models
|
|
{
|
|
public class GaseousGame : IGDB.Models.Game
|
|
{
|
|
public GaseousGame()
|
|
{
|
|
|
|
}
|
|
|
|
public GaseousGame(IGDB.Models.Game game)
|
|
{
|
|
var targetType = this.GetType();
|
|
var sourceType = game.GetType();
|
|
foreach(var prop in targetType.GetProperties(BindingFlags.Instance | BindingFlags.Public| BindingFlags.SetProperty))
|
|
{
|
|
// check whether source object has the the property
|
|
var sp = sourceType.GetProperty(prop.Name);
|
|
if (sp != null)
|
|
{
|
|
// if yes, copy the value to the matching property
|
|
var value = sp.GetValue(game, null);
|
|
prop.SetValue(this, value, null);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool HasSavedGame { get; set; } = false;
|
|
|
|
public IGDB.Models.Cover? CoverItem
|
|
{
|
|
get
|
|
{
|
|
if (this.Cover != null)
|
|
{
|
|
if (this.Cover.Id != null)
|
|
{
|
|
IGDB.Models.Cover cover = Covers.GetCover(Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(this), false);
|
|
|
|
return cover;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
} |