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/CTGConfig.cs | 88 ++++++++++++++++++++++---------------------
1 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/Core/GameEngine/Model/Config/CTGConfig.cs b/Core/GameEngine/Model/Config/CTGConfig.cs
index 0f7c329..e945bfd 100644
--- a/Core/GameEngine/Model/Config/CTGConfig.cs
+++ b/Core/GameEngine/Model/Config/CTGConfig.cs
@@ -1,62 +1,64 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Thursday, July 26, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
public partial class CTGConfig : ConfigBase {
- public int RecordID { get ; private set ; }
- public string Title { get ; private set; }
- public int DailyBuyCount { get ; private set ; }
- public int GainGold { get ; private set ; }
- public int GainGoldPaper { get ; private set ; }
- public int FirstGoldPaperPrize { get ; private set ; }
- public string GainItemList { get ; private set; }
- public string Icon { get ; private set; }
- public int PayType { get ; private set ; }
-
+ public int RecordID;
+ public string Title;
+ public int DailyBuyCount;
+ public int GainGold;
+ public int GainGoldPaper;
+ public int FirstGoldPaperPrize;
+ public string GainItemList;
+ public string Icon;
+ public int PayType;
+
public override string getKey()
{
return RecordID.ToString();
- }
-
- public override void Parse() {
+ }
+
+ public override void Parse(string content) {
try
{
- RecordID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out RecordID);
- Title = rawContents[1].Trim();
+ Title = contents[1];
- DailyBuyCount=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out DailyBuyCount);
- GainGold=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out GainGold);
- GainGoldPaper=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out GainGoldPaper);
- FirstGoldPaperPrize=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
+ int.TryParse(contents[5],out FirstGoldPaperPrize);
- GainItemList = rawContents[6].Trim();
+ GainItemList = contents[6];
- Icon = rawContents[7].Trim();
+ Icon = contents[7];
- PayType=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0;
+ int.TryParse(contents[8],out PayType);
}
catch (Exception ex)
{
DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0