mlaumcherb/Млаумчерб.Клиент/классы/GameVersionProps.cs
2024-09-24 16:18:06 +05:00

33 lines
981 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace Млаумчерб.Клиент.классы;
public class GameVersionProps
{
public string Name { get; }
public IOPath LocalDescriptorPath { get; }
public string? RemoteDescriptorUrl { get; }
private bool _isDownloaded;
public bool IsDownloaded
{
get => _isDownloaded;
set
{
_isDownloaded = value;
DownloadCompleted?.Invoke();
}
}
public event Action? DownloadCompleted;
public GameVersionProps(string name, string? url, IOPath descriptorPath)
{
Name = name;
LocalDescriptorPath = descriptorPath;
RemoteDescriptorUrl = url;
IsDownloaded = File.Exists(Пролетариат.GetVersionJarFilePath(name));
}
public GameVersionProps(string name, string? url) :
this(name, url, Пролетариат.GetVersionDescriptorPath(name)) { }
public override string ToString() => Name;
}