mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-25 07:42:58 +01:00
26 lines
904 B
C#
26 lines
904 B
C#
namespace Phantom.Common.Data.Replies;
|
|
|
|
public enum StopInstanceResult {
|
|
StopInitiated,
|
|
AgentShuttingDown,
|
|
InstanceDoesNotExist,
|
|
InstanceAlreadyStopping,
|
|
InstanceAlreadyStopped,
|
|
CommunicationError,
|
|
UnknownError
|
|
}
|
|
|
|
public static class StopInstanceResultExtensions {
|
|
public static string ToSentence(this StopInstanceResult reason) {
|
|
return reason switch {
|
|
StopInstanceResult.StopInitiated => "Stopping initiated.",
|
|
StopInstanceResult.AgentShuttingDown => "Agent is shutting down.",
|
|
StopInstanceResult.InstanceDoesNotExist => "Instance does not exist.",
|
|
StopInstanceResult.InstanceAlreadyStopping => "Instance is already stopping.",
|
|
StopInstanceResult.InstanceAlreadyStopped => "Instance is already stopped.",
|
|
StopInstanceResult.CommunicationError => "Communication error.",
|
|
_ => "Unknown error."
|
|
};
|
|
}
|
|
}
|