From 2c4887faa4538c9a229c9ccdb3ab6455a28b2b3f Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 27 三月 2019 14:25:13 +0800
Subject: [PATCH] Merge branch 'TreasureMission'
---
Core/GameEngine/Model/Config/TreasureUpConfig.cs | 409 ++++++++++++++++++++++++++++-----------------------------
1 files changed, 200 insertions(+), 209 deletions(-)
diff --git a/Core/GameEngine/Model/Config/TreasureUpConfig.cs b/Core/GameEngine/Model/Config/TreasureUpConfig.cs
index 2d2f5ef..02056c1 100644
--- a/Core/GameEngine/Model/Config/TreasureUpConfig.cs
+++ b/Core/GameEngine/Model/Config/TreasureUpConfig.cs
@@ -1,18 +1,18 @@
-锘�//--------------------------------------------------------
-// [Author]: Fish
-// [ Date ]: Thursday, February 14, 2019
-//--------------------------------------------------------
-
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System;
-using UnityEngine;
-
-[XLua.LuaCallCSharp]
-public partial class TreasureUpConfig
-{
-
+锘�//--------------------------------------------------------
+// [Author]: Fish
+// [ Date ]: Wednesday, March 27, 2019
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+
+[XLua.LuaCallCSharp]
+public partial class TreasureUpConfig
+{
+
public readonly int ID;
public readonly int MWID;
public readonly int LV;
@@ -20,22 +20,19 @@
public readonly string AddAttr;
public readonly int[] UnLockSkill;
public readonly int UnLockFuncID;
- public readonly int ActiveMWID;
- public readonly string ItemAward;
- public readonly int SoulID;
public readonly int PowerEx;
- public readonly string DescriptionMainWin;
-
- public TreasureUpConfig()
- {
- }
-
- public TreasureUpConfig(string input)
- {
- try
- {
- var tables = input.Split('\t');
-
+ public readonly string DescriptionMainWin;
+
+ public TreasureUpConfig()
+ {
+ }
+
+ public TreasureUpConfig(string input)
+ {
+ try
+ {
+ var tables = input.Split('\t');
+
int.TryParse(tables[0],out ID);
int.TryParse(tables[1],out MWID);
@@ -55,183 +52,177 @@
int.TryParse(tables[6],out UnLockFuncID);
- int.TryParse(tables[7],out ActiveMWID);
+ int.TryParse(tables[7],out PowerEx);
- ItemAward = tables[8];
-
- int.TryParse(tables[9],out SoulID);
-
- int.TryParse(tables[10],out PowerEx);
-
- DescriptionMainWin = tables[11];
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- static Dictionary<string, TreasureUpConfig> configs = new Dictionary<string, TreasureUpConfig>();
- public static TreasureUpConfig Get(string id)
- {
- if (!inited)
- {
- Debug.Log("TreasureUpConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
- return null;
- }
-
- if (configs.ContainsKey(id))
- {
- return configs[id];
- }
-
- TreasureUpConfig config = null;
- if (rawDatas.ContainsKey(id))
- {
- config = configs[id] = new TreasureUpConfig(rawDatas[id]);
- rawDatas.Remove(id);
- }
-
- return config;
- }
-
- public static TreasureUpConfig Get(int id)
- {
- return Get(id.ToString());
- }
-
- public static List<string> GetKeys()
- {
- var keys = new List<string>();
- keys.AddRange(configs.Keys);
- keys.AddRange(rawDatas.Keys);
- return keys;
- }
-
- public static List<TreasureUpConfig> GetValues()
- {
- var values = new List<TreasureUpConfig>();
- values.AddRange(configs.Values);
-
- var keys = new List<string>(rawDatas.Keys);
- foreach (var key in keys)
- {
- values.Add(Get(key));
- }
-
- return values;
- }
-
- public static bool Has(string id)
- {
- return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
- }
-
- public static bool Has(int id)
- {
- return Has(id.ToString());
- }
-
- public static bool inited { get; private set; }
- protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
- public static void Init(bool sync=false)
- {
- inited = false;
- var path = string.Empty;
- if (AssetSource.refdataFromEditor)
- {
- path = ResourcesPath.CONFIG_FODLER +"/TreasureUp.txt";
- }
- else
- {
- path = AssetVersionUtility.GetAssetFilePath("config/TreasureUp.txt");
- }
-
- var tempConfig = new TreasureUpConfig();
- var preParse = tempConfig is IConfigPostProcess;
-
- if (sync)
- {
- var lines = File.ReadAllLines(path);
- if (!preParse)
- {
- rawDatas = new Dictionary<string, string>(lines.Length - 3);
- }
- for (int i = 3; i < lines.Length; i++)
- {
- try
- {
- var line = lines[i];
- var index = line.IndexOf("\t");
- if (index == -1)
- {
- continue;
- }
- var id = line.Substring(0, index);
-
- if (preParse)
- {
- var config = new TreasureUpConfig(line);
- configs[id] = config;
- (config as IConfigPostProcess).OnConfigParseCompleted();
- }
- else
- {
- rawDatas[id] = line;
- }
- }
- catch (System.Exception ex)
- {
- Debug.LogError(ex);
- }
- }
- inited = true;
- }
- else
- {
- ThreadPool.QueueUserWorkItem((object _object) =>
- {
- var lines = File.ReadAllLines(path);
- if (!preParse)
- {
- rawDatas = new Dictionary<string, string>(lines.Length - 3);
- }
- for (int i = 3; i < lines.Length; i++)
- {
- try
- {
- var line = lines[i];
- var index = line.IndexOf("\t");
- if (index == -1)
- {
- continue;
- }
- var id = line.Substring(0, index);
-
- if (preParse)
- {
- var config = new TreasureUpConfig(line);
- configs[id] = config;
- (config as IConfigPostProcess).OnConfigParseCompleted();
- }
- else
- {
- rawDatas[id] = line;
- }
- }
- catch (System.Exception ex)
- {
- Debug.LogError(ex);
- }
- }
-
- inited = true;
- });
- }
- }
-
-}
-
-
-
-
+ DescriptionMainWin = tables[8];
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ static Dictionary<string, TreasureUpConfig> configs = new Dictionary<string, TreasureUpConfig>();
+ public static TreasureUpConfig Get(string id)
+ {
+ if (!inited)
+ {
+ Debug.Log("TreasureUpConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
+ return null;
+ }
+
+ if (configs.ContainsKey(id))
+ {
+ return configs[id];
+ }
+
+ TreasureUpConfig config = null;
+ if (rawDatas.ContainsKey(id))
+ {
+ config = configs[id] = new TreasureUpConfig(rawDatas[id]);
+ rawDatas.Remove(id);
+ }
+
+ return config;
+ }
+
+ public static TreasureUpConfig Get(int id)
+ {
+ return Get(id.ToString());
+ }
+
+ public static List<string> GetKeys()
+ {
+ var keys = new List<string>();
+ keys.AddRange(configs.Keys);
+ keys.AddRange(rawDatas.Keys);
+ return keys;
+ }
+
+ public static List<TreasureUpConfig> GetValues()
+ {
+ var values = new List<TreasureUpConfig>();
+ values.AddRange(configs.Values);
+
+ var keys = new List<string>(rawDatas.Keys);
+ foreach (var key in keys)
+ {
+ values.Add(Get(key));
+ }
+
+ return values;
+ }
+
+ public static bool Has(string id)
+ {
+ return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
+ }
+
+ public static bool Has(int id)
+ {
+ return Has(id.ToString());
+ }
+
+ public static bool inited { get; private set; }
+ protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
+ public static void Init(bool sync=false)
+ {
+ inited = false;
+ var path = string.Empty;
+ if (AssetSource.refdataFromEditor)
+ {
+ path = ResourcesPath.CONFIG_FODLER +"/TreasureUp.txt";
+ }
+ else
+ {
+ path = AssetVersionUtility.GetAssetFilePath("config/TreasureUp.txt");
+ }
+
+ var tempConfig = new TreasureUpConfig();
+ var preParse = tempConfig is IConfigPostProcess;
+
+ if (sync)
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new TreasureUpConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+ inited = true;
+ }
+ else
+ {
+ ThreadPool.QueueUserWorkItem((object _object) =>
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new TreasureUpConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+
+ inited = true;
+ });
+ }
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0