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/PetClassCostConfig.cs | 98 +++++++++++++++++++++++++------------------------
1 files changed, 50 insertions(+), 48 deletions(-)
diff --git a/Core/GameEngine/Model/Config/PetClassCostConfig.cs b/Core/GameEngine/Model/Config/PetClassCostConfig.cs
index d431949..be2b061 100644
--- a/Core/GameEngine/Model/Config/PetClassCostConfig.cs
+++ b/Core/GameEngine/Model/Config/PetClassCostConfig.cs
@@ -1,53 +1,55 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Friday, January 04, 2019
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class PetClassCostConfig : ConfigBase {
-
- public int ID { get ; private set ; }
- public int PetID { get ; private set ; }
- public int Rank { get ; private set ; }
- public int UpNeedExp { get ; private set ; }
- public int AtkAdd { get ; private set ; }
- public int NeedExpTotal { get ; private set ; }
-
- public override string getKey()
- {
- return ID.ToString();
- }
-
- public override void Parse() {
- try
- {
- ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class PetClassCostConfig : ConfigBase {
+
+ public int ID;
+ public int PetID;
+ public int Rank;
+ public int UpNeedExp;
+ public int AtkAdd;
+ public int NeedExpTotal;
+
+ public override string getKey()
+ {
+ return ID.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out ID);
- PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out PetID);
- Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out Rank);
- UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out UpNeedExp);
- AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out AtkAdd);
- NeedExpTotal=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ int.TryParse(contents[5],out NeedExpTotal);
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0