using System.Collections.Generic; using System.ComponentModel; using Cal.DataTable; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using ProtoBuf; namespace Cal.DataTable { public partial class AIConfigCategory { public Dictionary> AIConfigs = new Dictionary>(); public SortedDictionary GetAI(int aiConfigId) { return this.AIConfigs[aiConfigId]; } public override void EndInit() { base.EndInit(); foreach (var kv in this.dict) { SortedDictionary aiNodeConfig; if (!this.AIConfigs.TryGetValue(kv.Value.AIConfigId, out aiNodeConfig)) { aiNodeConfig = new SortedDictionary(); this.AIConfigs.Add(kv.Value.AIConfigId, aiNodeConfig); } aiNodeConfig.Add(kv.Key, kv.Value); } } } }