steam-deck-tools/SteamController/Profiles/Profile.cs
Kamil Trzciński e5debff45b SteamController: Use Roslyn Scripting to compile UserProfiles
- This looks into `UserProfiles/` and compiles user profiles
- This exposes a very minimal scripting interface as defined by `Dynamic.Globals`
2023-01-03 11:34:40 +01:00

35 lines
940 B
C#

namespace SteamController.Profiles
{
public abstract class Profile
{
public struct Status
{
public static readonly Status Continue = new Status() { IsDone = false };
public static readonly Status Done = new Status() { IsDone = true };
public bool IsDone { get; set; }
}
public event Action<string[]> ErrorsChanged;
public virtual String Name { get; set; } = "";
public virtual bool Visible { get; set; } = true;
public virtual bool IsDesktop { get; set; }
public virtual string[]? Errors { get; set; }
public abstract bool Selected(Context context);
public abstract Status Run(Context context);
public Profile()
{
ErrorsChanged += delegate { };
}
protected void OnErrorsChanged()
{
ErrorsChanged(this.Errors ?? new string[0]);
}
}
}