Init commit
This commit is contained in:
commit
0c711f7da6
26 changed files with 1733 additions and 0 deletions
61
GoldbergGUI.Core/Models/SteamAppModel.cs
Normal file
61
GoldbergGUI.Core/Models/SteamAppModel.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.RegularExpressions;
|
||||
using GoldbergGUI.Core.Utils;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
// ReSharper disable CollectionNeverUpdated.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
// ReSharper disable StringLiteralTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
namespace GoldbergGUI.Core.Models
|
||||
{
|
||||
public class SteamApp
|
||||
{
|
||||
private string _name;
|
||||
private string _comparableName;
|
||||
[JsonPropertyName("appid")] public int AppId { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set
|
||||
{
|
||||
_name = value;
|
||||
_comparableName = Regex.Replace(value, Misc.SpecialCharsRegex, "").ToLower();
|
||||
}
|
||||
}
|
||||
|
||||
public bool CompareName(string value)
|
||||
{
|
||||
return _comparableName.Equals(value);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{AppId}={Name}";
|
||||
}
|
||||
}
|
||||
|
||||
public class AppList
|
||||
{
|
||||
[JsonPropertyName("apps")] public List<SteamApp> Apps { get; set; }
|
||||
}
|
||||
|
||||
public class SteamApps
|
||||
{
|
||||
[JsonPropertyName("applist")] public AppList AppList { get; set; }
|
||||
}
|
||||
public static class AppType
|
||||
{
|
||||
public const string Game = "game";
|
||||
public const string DLC = "dlc";
|
||||
public const string Music = "music";
|
||||
public const string Demo = "demo";
|
||||
public const string Ad = "advertising";
|
||||
public const string Mod = "mod";
|
||||
public const string Video = "video";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue