1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

[3.2] C#: Rewrite GodotTools messaging protocol

This commit is contained in:
Ignacio Etcheverry
2020-05-09 20:45:43 +02:00
parent aa57bb0473
commit fb2e00a854
44 changed files with 2252 additions and 1142 deletions

View File

@@ -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;
}
}
}