Files
SteamTools/System.Application.SteamTools.Client.Desktop/Models/StatInfo.cs
T
Aigio Liu 5de392588e fix
2021-02-24 22:29:08 +08:00

47 lines
1.1 KiB
C#

using System.ComponentModel;
namespace System.Application.Models
{
public abstract class StatInfo
{
public abstract bool IsModified { get; }
public string? Id { get; set; }
public string? DisplayName { get; set; }
public abstract object Value { get; set; }
public bool IsIncrementOnly { get; set; }
public int Permission { get; set; }
public string Extra
{
get
{
var flags = StatFlags.None;
flags |= IsIncrementOnly == false ? 0 : StatFlags.IncrementOnly;
flags |= (Permission & 2) != 0 == false ? 0 : StatFlags.Protected;
flags |= (Permission & ~2) != 0 == false ? 0 : StatFlags.UnknownPermission;
return flags.ToString();
}
}
}
[Flags]
public enum StatFlags
{
[Description("默认")]
None = 0,
[Description("仅增加")]
IncrementOnly = 1 << 0,
[Description("受保护")]
Protected = 1 << 1,
[Description("未知权限")]
UnknownPermission = 1 << 2,
}
}