From b3bfb681c8ae862cafdb9e74e7f7708aa93f28a6 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期五, 16 十一月 2018 14:58:43 +0800
Subject: [PATCH] 4736 子 【1.3】【前端】神兵系统修改 / 【1.3】神兵系统界面逻辑修改
---
Core/GameEngine/Model/TelPartialConfig/tagGodWeaponConfig.cs | 41 +++++++++++++++++++++++++----------------
1 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/Core/GameEngine/Model/TelPartialConfig/tagGodWeaponConfig.cs b/Core/GameEngine/Model/TelPartialConfig/tagGodWeaponConfig.cs
index e24eea0..9ed8708 100644
--- a/Core/GameEngine/Model/TelPartialConfig/tagGodWeaponConfig.cs
+++ b/Core/GameEngine/Model/TelPartialConfig/tagGodWeaponConfig.cs
@@ -6,36 +6,45 @@
{
public partial class GodWeaponConfig : ConfigBase, IConfigPostProcess
{
- private static Dictionary<string, GodWeaponConfig> m_GodWeaponCfgs = new Dictionary<string, GodWeaponConfig>();
-
- private static Dictionary<int, List<GodWeaponConfig>> m_GodWeaponList = new Dictionary<int, List<GodWeaponConfig>>();
+ static Dictionary<int, Dictionary<int, GodWeaponConfig>> m_GodWeaponDict = new Dictionary<int, Dictionary<int, GodWeaponConfig>>();
+ static Dictionary<int, List<GodWeaponConfig>> m_GodWeaponList = new Dictionary<int, List<GodWeaponConfig>>();
public void OnConfigParseCompleted()
{
- m_GodWeaponCfgs.Add(StringUtility.Contact(Type, Lv).ToString(), this);
+ Dictionary<int, GodWeaponConfig> dict;
+ if (!m_GodWeaponDict.TryGetValue(Type, out dict))
+ {
+ dict = new Dictionary<int, GodWeaponConfig>();
+ m_GodWeaponDict.Add(Type, dict);
+ }
+ if (!dict.ContainsKey(Lv))
+ {
+ dict.Add(Lv, this);
+ }
List<GodWeaponConfig> list = null;
- m_GodWeaponList.TryGetValue(Type, out list);
- if (list == null)
+ if (!m_GodWeaponList.TryGetValue(Type, out list))
{
list = new List<GodWeaponConfig>();
- list.Add(this);
m_GodWeaponList.Add(Type, list);
}
- else
- {
- list.Add(this);
- }
+ list.Add(this);
}
- public static GodWeaponConfig GetGodWeaponCfgByTypeLv(int type, int lv)
+ public static GodWeaponConfig GetConfig(int type, int level)
{
- GodWeaponConfig cfg = null;
- m_GodWeaponCfgs.TryGetValue(StringUtility.Contact(type, lv), out cfg);
- return cfg;
+ Dictionary<int, GodWeaponConfig> dict;
+ if (m_GodWeaponDict.TryGetValue(type, out dict))
+ {
+ if (dict.ContainsKey(level))
+ {
+ return dict[level];
+ }
+ }
+ return null;
}
- public static List<GodWeaponConfig> GetGodWeaponCfgByType(int type)
+ public static List<GodWeaponConfig> GetConfigs(int type)
{
List<GodWeaponConfig> list = null;
m_GodWeaponList.TryGetValue(type, out list);
--
Gitblit v1.8.0