chinese_chess/Scripts/Lib/RPMessage.cs

33 lines
804 B
C#

using Godot;
using Godot.Collections;
namespace RPPackage {
public class RPMessage
{
public string Type { get; set; }
public string Cmd { get; set; }
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)
dict.Add("type", Type);
if (Cmd != null)
dict.Add("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;
}
}
}