initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
namespace GodotTools.IdeMessaging
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
public MessageKind Kind { get; }
|
||||
public string Id { get; }
|
||||
public MessageContent Content { get; }
|
||||
|
||||
public Message(MessageKind kind, string id, MessageContent content)
|
||||
{
|
||||
Kind = kind;
|
||||
Id = id;
|
||||
Content = content;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Kind} | {Id}";
|
||||
}
|
||||
}
|
||||
|
||||
public enum MessageKind
|
||||
{
|
||||
Request,
|
||||
Response
|
||||
}
|
||||
|
||||
public enum MessageStatus
|
||||
{
|
||||
Ok,
|
||||
RequestNotSupported,
|
||||
InvalidRequestBody
|
||||
}
|
||||
|
||||
public readonly struct MessageContent
|
||||
{
|
||||
public MessageStatus Status { get; }
|
||||
public string Body { get; }
|
||||
|
||||
public MessageContent(string body)
|
||||
{
|
||||
Status = MessageStatus.Ok;
|
||||
Body = body;
|
||||
}
|
||||
|
||||
public MessageContent(MessageStatus status, string body)
|
||||
{
|
||||
Status = status;
|
||||
Body = body;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user