using Godot; using Godot.Collections; namespace RPPackage { public class RPMessage { public string Type { get; set; } = string.Empty; public string Cmd { get; set; } = string.Empty; public Dictionary? Data { get; set; } public string? Uid { get; set; } public string? Token { get; set; } public string? Code { get; set; } public Dictionary ToDictionary() { var dict = new Dictionary { // if (Type != null) { "type", Type }, // if (Cmd != null) { "cmd", Cmd } }; if (Data != null) dict.Add("data", Data); if (Uid != null) dict.Add("uid", Uid); if (Token != null) dict.Add("token", Token); if (Code != null) dict.Add("code", Code); return dict; } } }