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/InSevenDaysConfig.cs | 114 +++++++++++++++++++++++++++++----------------------------
1 files changed, 58 insertions(+), 56 deletions(-)
diff --git a/Core/GameEngine/Model/Config/InSevenDaysConfig.cs b/Core/GameEngine/Model/Config/InSevenDaysConfig.cs
index d25cebe..49d848f 100644
--- a/Core/GameEngine/Model/Config/InSevenDaysConfig.cs
+++ b/Core/GameEngine/Model/Config/InSevenDaysConfig.cs
@@ -1,65 +1,67 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Wednesday, September 26, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class InSevenDaysConfig : ConfigBase {
-
- public int RewardID { get ; private set ; }
- public string Reward { get ; private set; }
- public string ICON { get ; private set; }
- public string RewardName { get ; private set; }
- public string Image { get ; private set; }
- public string ImgTxt1 { get ; private set; }
- public string ImgTxt2 { get ; private set; }
- public string DayIcon { get ; private set; }
- public int Money { get ; private set ; }
- public int IsTitle { get ; private set ; }
-
- public override string getKey()
- {
- return RewardID.ToString();
- }
-
- public override void Parse() {
- try
- {
- RewardID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class InSevenDaysConfig : ConfigBase {
+
+ public int RewardID;
+ public string Reward;
+ public string ICON;
+ public string RewardName;
+ public string Image;
+ public string ImgTxt1;
+ public string ImgTxt2;
+ public string DayIcon;
+ public int Money;
+ public int IsTitle;
+
+ public override string getKey()
+ {
+ return RewardID.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out RewardID);
- Reward = rawContents[1].Trim();
+ Reward = contents[1];
- ICON = rawContents[2].Trim();
+ ICON = contents[2];
- RewardName = rawContents[3].Trim();
+ RewardName = contents[3];
- Image = rawContents[4].Trim();
+ Image = contents[4];
- ImgTxt1 = rawContents[5].Trim();
+ ImgTxt1 = contents[5];
- ImgTxt2 = rawContents[6].Trim();
+ ImgTxt2 = contents[6];
- DayIcon = rawContents[7].Trim();
+ DayIcon = contents[7];
- Money=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0;
+ int.TryParse(contents[8],out Money);
- IsTitle=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0;
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ int.TryParse(contents[9],out IsTitle);
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0