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/TalentConfig.cs | 90 +++++++++++++++++++++++----------------------
1 files changed, 46 insertions(+), 44 deletions(-)
diff --git a/Core/GameEngine/Model/Config/TalentConfig.cs b/Core/GameEngine/Model/Config/TalentConfig.cs
index fcb36a4..1a3f5b9 100644
--- a/Core/GameEngine/Model/Config/TalentConfig.cs
+++ b/Core/GameEngine/Model/Config/TalentConfig.cs
@@ -1,47 +1,49 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Thursday, October 11, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class TalentConfig : ConfigBase {
-
- public int skillId { get ; private set ; }
- public int type { get ; private set ; }
- public int series { get ; private set ; }
- public int order { get ; private set ; }
-
- public override string getKey()
- {
- return skillId.ToString();
- }
-
- public override void Parse() {
- try
- {
- skillId=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class TalentConfig : ConfigBase {
+
+ public int skillId;
+ public int type;
+ public int series;
+ public int order;
+
+ public override string getKey()
+ {
+ return skillId.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out skillId);
- type=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out type);
- series=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out series);
- order=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ int.TryParse(contents[3],out order);
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0