2023-05-11 23:11:39 -04:00
|
|
|
|
using SPTInstaller.Interfaces;
|
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
namespace SPTInstaller.Models;
|
2023-05-11 23:11:39 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
public class Result : IResult
|
|
|
|
|
{
|
|
|
|
|
public bool Succeeded { get; private set; }
|
2024-05-01 10:31:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
public string Message { get; private set; }
|
2024-05-01 10:31:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
protected Result(string message, bool succeeded)
|
|
|
|
|
{
|
|
|
|
|
Message = message;
|
|
|
|
|
Succeeded = succeeded;
|
2023-05-11 23:11:39 -04:00
|
|
|
|
}
|
2024-05-01 10:31:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
public static Result FromSuccess(string message = "") => new(message, true);
|
|
|
|
|
public static Result FromError(string message) => new(message, false);
|
|
|
|
|
}
|