mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
33
Assets/GameScripts/DotNet/Model/Share/Module/AI/AIConfig.cs
Normal file
33
Assets/GameScripts/DotNet/Model/Share/Module/AI/AIConfig.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public partial class AIConfigCategory
|
||||
{
|
||||
[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 EndInit()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user