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/GuideConfig.cs |   86 ++++++++++++++++++++++---------------------
 1 files changed, 44 insertions(+), 42 deletions(-)

diff --git a/Core/GameEngine/Model/Config/GuideConfig.cs b/Core/GameEngine/Model/Config/GuideConfig.cs
index 016aff9..02a6863 100644
--- a/Core/GameEngine/Model/Config/GuideConfig.cs
+++ b/Core/GameEngine/Model/Config/GuideConfig.cs
@@ -1,67 +1,69 @@
-锘�//--------------------------------------------------------
-//    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Saturday, August 11, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-    
+锘�//--------------------------------------------------------
+//    [Author]:			绗簩涓栫晫
+//    [  Date ]:		   Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+    
 	public partial class GuideConfig : ConfigBase {
 
-		public int ID { get ; private set ; }
-		public int Type { get ; private set ; }
-		public int TriggerType { get ; private set ; }
-		public int Condition { get ; private set ; }
-		public int PreGuideId { get ; private set ; }
+		public int ID;
+		public int Type;
+		public int TriggerType;
+		public int Condition;
+		public int PreGuideId;
 		public int[] Steps;
-		public int CanSkip { get ; private set ; }
-		public int RemoveWhenOtherGuide { get ; private set ; }
-		public int CannotCompleteByClick { get ; private set ; }
-
+		public int CanSkip;
+		public int RemoveWhenOtherGuide;
+		public int CannotCompleteByClick;
+
 		public override string getKey()
         {
             return ID.ToString();
-        }
-
-		public override void Parse() {
+        }
+
+		public override void Parse(string content) {
 			try
             {
-                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; 
+                var contents = content.Split('\t');
+
+                int.TryParse(contents[0],out ID);
 			
-				Type=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; 
+				int.TryParse(contents[1],out Type);
 			
-				TriggerType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; 
+				int.TryParse(contents[2],out TriggerType);
 			
-				Condition=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; 
+				int.TryParse(contents[3],out Condition);
 			
-				PreGuideId=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; 
+				int.TryParse(contents[4],out PreGuideId);
 			
-				string[] StepsStringArray = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+				var StepsStringArray = contents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
 				Steps = new int[StepsStringArray.Length];
 				for (int i=0;i<StepsStringArray.Length;i++)
 				{
 					 int.TryParse(StepsStringArray[i],out Steps[i]);
 				}
 			
-				CanSkip=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; 
+				int.TryParse(contents[6],out CanSkip);
 			
-				RemoveWhenOtherGuide=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; 
+				int.TryParse(contents[7],out RemoveWhenOtherGuide);
 			
-				CannotCompleteByClick=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; 
+				int.TryParse(contents[8],out CannotCompleteByClick);
             }
             catch (Exception ex)
             {
                 DebugEx.Log(ex);
-            }
-		}
-	
-	}
-
-}
-
-
-
-
+            }
+		}
+	
+	}
+
+}
+
+
+
+

--
Gitblit v1.8.0