You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
872 B

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