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/mapnpcConfig.cs |  144 ++++++++++++++++++++++++-----------------------
 1 files changed, 73 insertions(+), 71 deletions(-)

diff --git a/Core/GameEngine/Model/Config/mapnpcConfig.cs b/Core/GameEngine/Model/Config/mapnpcConfig.cs
index cbea0fc..a713a86 100644
--- a/Core/GameEngine/Model/Config/mapnpcConfig.cs
+++ b/Core/GameEngine/Model/Config/mapnpcConfig.cs
@@ -1,104 +1,106 @@
-锘�//--------------------------------------------------------
-//    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Saturday, January 06, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-    
+锘�//--------------------------------------------------------
+//    [Author]:			绗簩涓栫晫
+//    [  Date ]:		   Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+    
 	public partial class mapnpcConfig : ConfigBase {
 
-		public string RefreshID { get ; private set; } 
-		public int NPCID { get ; private set ; }
-		public string NPCName { get ; private set; } 
-		public int NPCType { get ; private set ; }
-		public int NPCLv { get ; private set ; }
-		public int MapID { get ; private set ; }
-		public int Unknow1 { get ; private set ; }
-		public int Unknow2 { get ; private set ; }
-		public string HexPosNPCRefreshAreaChaseArea { get ; private set; } 
-		public int PerRefreshNum { get ; private set ; }
-		public int RefreshNum { get ; private set ; }
-		public int NPCFace { get ; private set ; }
-		public int Unknow3 { get ; private set ; }
-		public int RefreshTime { get ; private set ; }
-		public int Unknow4 { get ; private set ; }
-		public int Unknow5 { get ; private set ; }
-		public int Unknow6 { get ; private set ; }
-		public int Unknow7 { get ; private set ; }
-		public int NPCRoute { get ; private set ; }
-		public int StayMinTime { get ; private set ; }
-		public int StayMaxTime { get ; private set ; }
-		public int RefreshMark { get ; private set ; }
-		public int Unknow9 { get ; private set ; }
-
+		public int RefreshID;
+		public int NPCID;
+		public string NPCName;
+		public int NPCType;
+		public int NPCLv;
+		public int MapID;
+		public int Unknow1;
+		public int Unknow2;
+		public string HexPosNPCRefreshAreaChaseArea;
+		public int PerRefreshNum;
+		public int RefreshNum;
+		public int NPCFace;
+		public int Unknow3;
+		public int RefreshTime;
+		public int Unknow4;
+		public int Unknow5;
+		public int Unknow6;
+		public int Unknow7;
+		public int NPCRoute;
+		public int StayMinTime;
+		public int StayMaxTime;
+		public int RefreshMark;
+		public int Unknow9;
+
 		public override string getKey()
         {
             return RefreshID.ToString();
-        }
-
-		public override void Parse() {
+        }
+
+		public override void Parse(string content) {
 			try
             {
-                RefreshID = rawContents[0].Trim();
+                var contents = content.Split('\t');
+
+                int.TryParse(contents[0],out RefreshID);
 			
-				NPCID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; 
+				int.TryParse(contents[1],out NPCID);
 			
-				NPCName = rawContents[2].Trim();
+				NPCName = contents[2];
 			
-				NPCType=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; 
+				int.TryParse(contents[3],out NPCType);
 			
-				NPCLv=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; 
+				int.TryParse(contents[4],out NPCLv);
 			
-				MapID=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; 
+				int.TryParse(contents[5],out MapID);
 			
-				Unknow1=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; 
+				int.TryParse(contents[6],out Unknow1);
 			
-				Unknow2=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; 
+				int.TryParse(contents[7],out Unknow2);
 			
-				HexPosNPCRefreshAreaChaseArea = rawContents[8].Trim();
+				HexPosNPCRefreshAreaChaseArea = contents[8];
 			
-				PerRefreshNum=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; 
+				int.TryParse(contents[9],out PerRefreshNum);
 			
-				RefreshNum=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; 
+				int.TryParse(contents[10],out RefreshNum);
 			
-				NPCFace=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; 
+				int.TryParse(contents[11],out NPCFace);
 			
-				Unknow3=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; 
+				int.TryParse(contents[12],out Unknow3);
 			
-				RefreshTime=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; 
+				int.TryParse(contents[13],out RefreshTime);
 			
-				Unknow4=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; 
+				int.TryParse(contents[14],out Unknow4);
 			
-				Unknow5=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; 
+				int.TryParse(contents[15],out Unknow5);
 			
-				Unknow6=IsNumeric(rawContents[16]) ? int.Parse(rawContents[16]):0; 
+				int.TryParse(contents[16],out Unknow6);
 			
-				Unknow7=IsNumeric(rawContents[17]) ? int.Parse(rawContents[17]):0; 
+				int.TryParse(contents[17],out Unknow7);
 			
-				NPCRoute=IsNumeric(rawContents[18]) ? int.Parse(rawContents[18]):0; 
+				int.TryParse(contents[18],out NPCRoute);
 			
-				StayMinTime=IsNumeric(rawContents[19]) ? int.Parse(rawContents[19]):0; 
+				int.TryParse(contents[19],out StayMinTime);
 			
-				StayMaxTime=IsNumeric(rawContents[20]) ? int.Parse(rawContents[20]):0; 
+				int.TryParse(contents[20],out StayMaxTime);
 			
-				RefreshMark=IsNumeric(rawContents[21]) ? int.Parse(rawContents[21]):0; 
+				int.TryParse(contents[21],out RefreshMark);
 			
-				Unknow9=IsNumeric(rawContents[22]) ? int.Parse(rawContents[22]):0; 
+				int.TryParse(contents[22],out Unknow9);
             }
             catch (Exception ex)
             {
                 DebugEx.Log(ex);
-            }
-		}
-	
-	}
-
-}
-
-
-
-
+            }
+		}
+	
+	}
+
+}
+
+
+
+

--
Gitblit v1.8.0