using System.Collections.Generic; namespace etoy { /// /// 黑板 (这里用来存放Pileline产生的各种内存信息) /// class Blackboard { /// 配置表版本号 public string Version; /// 时间戳 public long Timestamp; /// 解析完后的配置表 public List Tables = new List
(); /// 解析完后的KeyValue表 public List KeyValueTables = new List(); /// 解析完后的Metadata表 public List MetadataTables = new List(); /// /// Metadata是否包含类型 /// /// /// public bool ContainsMetadataType(string typeName) { foreach (var table in MetadataTables) if (table.Structs.ContainsKey(typeName)) return true; return false; } /// /// 尝试获取Metadata /// /// /// /// public bool TryGetMetadata(string typeName, out MetadataStruct metadata) { metadata = null; foreach (var table in MetadataTables) return table.Structs.TryGetValue(typeName, out metadata); return false; } } }