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/GatherSoulComposeConfig.cs | 96 ++++++++++++++++++++++++-----------------------
1 files changed, 49 insertions(+), 47 deletions(-)
diff --git a/Core/GameEngine/Model/Config/GatherSoulComposeConfig.cs b/Core/GameEngine/Model/Config/GatherSoulComposeConfig.cs
index 3674fa0..cf4341f 100644
--- a/Core/GameEngine/Model/Config/GatherSoulComposeConfig.cs
+++ b/Core/GameEngine/Model/Config/GatherSoulComposeConfig.cs
@@ -1,58 +1,60 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Thursday, December 13, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class GatherSoulComposeConfig : ConfigBase {
-
- public int TagItemID { get ; private set ; }
- public int NeedLV { get ; private set ; }
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class GatherSoulComposeConfig : ConfigBase {
+
+ public int TagItemID;
+ public int NeedLV;
public int[] NeedItem;
- public int NeedSoulSplinters { get ; private set ; }
- public int NeedSoulCore { get ; private set ; }
- public int category { get ; private set ; }
-
- public override string getKey()
- {
- return TagItemID.ToString();
- }
-
- public override void Parse() {
- try
- {
- TagItemID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ public int NeedSoulSplinters;
+ public int NeedSoulCore;
+ public int category;
+
+ public override string getKey()
+ {
+ return TagItemID.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out TagItemID);
- NeedLV=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out NeedLV);
- string[] NeedItemStringArray = rawContents[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var NeedItemStringArray = contents[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
NeedItem = new int[NeedItemStringArray.Length];
for (int i=0;i<NeedItemStringArray.Length;i++)
{
int.TryParse(NeedItemStringArray[i],out NeedItem[i]);
}
- NeedSoulSplinters=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out NeedSoulSplinters);
- NeedSoulCore=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out NeedSoulCore);
- category=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ int.TryParse(contents[5],out category);
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0