37 lines
892 B
C#
37 lines
892 B
C#
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<int, SortedDictionary<long, AIConfig>> AIConfigs = new Dictionary<int, SortedDictionary<long, AIConfig>>();
|
|
|
|
public SortedDictionary<long, AIConfig> GetAI(int aiConfigId)
|
|
{
|
|
return this.AIConfigs[aiConfigId];
|
|
}
|
|
|
|
public override void EndInit()
|
|
{
|
|
base.EndInit();
|
|
|
|
foreach (var kv in this.dict)
|
|
{
|
|
SortedDictionary<long, AIConfig> aiNodeConfig;
|
|
if (!this.AIConfigs.TryGetValue(kv.Value.AIConfigId, out aiNodeConfig))
|
|
{
|
|
aiNodeConfig = new SortedDictionary<long, AIConfig>();
|
|
this.AIConfigs.Add(kv.Value.AIConfigId, aiNodeConfig);
|
|
}
|
|
|
|
aiNodeConfig.Add(kv.Key, kv.Value);
|
|
}
|
|
}
|
|
}
|
|
}
|