using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YLBattle { /// /// 消息定义 /// 消息不能被持有,处理完成后会自动回收 /// public class FieldEvent { /// /// 事件序号 /// public int id = 0; /// /// 发生时间 /// public long ts = 0; /// /// 事件类型 /// public EFieldEventType type = EFieldEventType.EFIELD_EVENT_NONE; /// /// 附加参数 /// private Dictionary values = new Dictionary(); /// /// 参数压入 /// /// 键 /// 值 public void PutValue(string key, string val) { this.values.Add(key, val); } /// /// 获取指定参数 /// /// 键 /// 失败string.empty public string GetValue(string key) { if (this.values.ContainsKey(key)) { return this.values[key]; } return string.Empty; } } }