From 1aeb815836d84ecfddf761a47862efebbba0ad03 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 12 二月 2019 21:55:16 +0800
Subject: [PATCH] 3335 配置表读取重构。

---
 Core/GameEngine/Model/Config/DamageNumConfig.cs |   74 +++++++++++++++++++------------------
 1 files changed, 38 insertions(+), 36 deletions(-)

diff --git a/Core/GameEngine/Model/Config/DamageNumConfig.cs b/Core/GameEngine/Model/Config/DamageNumConfig.cs
index d532630..ffdf7c0 100644
--- a/Core/GameEngine/Model/Config/DamageNumConfig.cs
+++ b/Core/GameEngine/Model/Config/DamageNumConfig.cs
@@ -1,42 +1,44 @@
-锘�//--------------------------------------------------------
-//    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Thursday, August 02, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-    
+锘�//--------------------------------------------------------
+//    [Author]:			绗簩涓栫晫
+//    [  Date ]:		   Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+    
 	public partial class DamageNumConfig : ConfigBase {
 
-		public string id { get ; private set; } 
-		public int realm { get ; private set ; }
-		public int prefix { get ; private set ; }
-		public int plus { get ; private set ; }
-		public int minus { get ; private set ; }
+		public string id;
+		public int realm;
+		public int prefix;
+		public int plus;
+		public int minus;
 		public int[] nums;
-
+
 		public override string getKey()
         {
             return id.ToString();
-        }
-
-		public override void Parse() {
+        }
+
+		public override void Parse(string content) {
 			try
             {
-                id = rawContents[0].Trim();
+                var contents = content.Split('\t');
+
+                id = contents[0];
 			
-				realm=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; 
+				int.TryParse(contents[1],out realm);
 			
-				prefix=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; 
+				int.TryParse(contents[2],out prefix);
 			
-				plus=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; 
+				int.TryParse(contents[3],out plus);
 			
-				minus=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; 
+				int.TryParse(contents[4],out minus);
 			
-				string[] numsStringArray = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+				var numsStringArray = contents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
 				nums = new int[numsStringArray.Length];
 				for (int i=0;i<numsStringArray.Length;i++)
 				{
@@ -46,13 +48,13 @@
             catch (Exception ex)
             {
                 DebugEx.Log(ex);
-            }
-		}
-	
-	}
-
-}
-
-
-
-
+            }
+		}
+	
+	}
+
+}
+
+
+
+

--
Gitblit v1.8.0