mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-05-31 07:34:03 +02:00
23 lines
738 B
C#
23 lines
738 B
C#
namespace Phantom.Server.Services.Instances;
|
|
|
|
public enum AddInstanceResult : byte {
|
|
UnknownError,
|
|
Success,
|
|
InstanceAlreadyExists,
|
|
InstanceNameMustNotBeEmpty,
|
|
InstanceMemoryMustNotBeZero,
|
|
AgentNotFound
|
|
}
|
|
|
|
public static class AddInstanceResultExtensions {
|
|
public static string ToSentence(this AddInstanceResult reason) {
|
|
return reason switch {
|
|
AddInstanceResult.Success => "Success.",
|
|
AddInstanceResult.InstanceNameMustNotBeEmpty => "Instance name must not be empty.",
|
|
AddInstanceResult.InstanceMemoryMustNotBeZero => "Memory must not be 0 MB.",
|
|
AddInstanceResult.AgentNotFound => "Agent not found.",
|
|
_ => "Unknown error."
|
|
};
|
|
}
|
|
}
|