InstalledGameVersionCatalog
This commit is contained in:
@@ -9,13 +9,13 @@ public record VersionSearchParams
|
||||
}
|
||||
|
||||
public class GameVersionCatalog
|
||||
{
|
||||
[JsonRequired] public List<RemoteVersionDescriptorProps> versions { get; set; } = null!;
|
||||
{
|
||||
[JsonRequired] public List<RemoteVersionDescriptorProps> versions { get; set; } = new();
|
||||
|
||||
/// <returns>empty list if couldn't find any remote versions</returns>
|
||||
public List<GameVersionProps> GetDownloadableVersions(VersionSearchParams p)
|
||||
public List<RemoteVersionDescriptorProps> GetDownloadableVersions(VersionSearchParams p)
|
||||
{
|
||||
var _versionPropsList = new List<GameVersionProps>();
|
||||
var _versionPropsList = new List<RemoteVersionDescriptorProps>();
|
||||
foreach (var r in versions)
|
||||
{
|
||||
bool match = r.type switch
|
||||
@@ -26,7 +26,7 @@ public class GameVersionCatalog
|
||||
_ => p.OtherTypeAllowed
|
||||
};
|
||||
if(match)
|
||||
_versionPropsList.Add(new GameVersionProps(r));
|
||||
_versionPropsList.Add(r);
|
||||
}
|
||||
return _versionPropsList;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GameVersionDescriptor
|
||||
[JsonRequired] public DateTime releaseTime { get; set; }
|
||||
[JsonRequired] public string type { get; set; } = "";
|
||||
[JsonRequired] public string mainClass { get; set; } = "";
|
||||
[JsonRequired] public List<Library> libraries { get; set; } = null!;
|
||||
[JsonRequired] public List<Library> libraries { get; set; } = new();
|
||||
[JsonRequired] public AssetIndexProperties assetIndex { get; set; } = null!;
|
||||
[JsonRequired] public string assets { get; set; } = "";
|
||||
public Downloads? downloads { get; set; } = null;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class JavaVersionProps
|
||||
|
||||
public class JavaDistributiveManifest
|
||||
{
|
||||
[JsonRequired] public Dictionary<string, JavaDistributiveElementProps> files { get; set; } = null!;
|
||||
[JsonRequired] public Dictionary<string, JavaDistributiveElementProps> files { get; set; } = new();
|
||||
}
|
||||
|
||||
public class JavaDistributiveElementProps
|
||||
|
||||
Reference in New Issue
Block a user