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/FestivalRedpackTaskConfig.cs | 92 +++++++++++++++++++++++----------------------
1 files changed, 47 insertions(+), 45 deletions(-)
diff --git a/Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs b/Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs
index 8adbda1..e0e6f0c 100644
--- a/Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs
+++ b/Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs
@@ -1,55 +1,57 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Tuesday, January 29, 2019
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class FestivalRedpackTaskConfig : ConfigBase {
-
- public int ID { get ; private set ; }
- public int FeastDay { get ; private set ; }
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class FestivalRedpackTaskConfig : ConfigBase {
+
+ public int ID;
+ public int FeastDay;
public int[] achievements;
- public string typeName { get ; private set; }
- public string Icon { get ; private set; }
-
- public override string getKey()
- {
- return ID.ToString();
- }
-
- public override void Parse() {
- try
- {
- ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ public string typeName;
+ public string Icon;
+
+ 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);
- FeastDay=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out FeastDay);
- string[] achievementsStringArray = rawContents[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var achievementsStringArray = contents[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
achievements = new int[achievementsStringArray.Length];
for (int i=0;i<achievementsStringArray.Length;i++)
{
int.TryParse(achievementsStringArray[i],out achievements[i]);
}
- typeName = rawContents[3].Trim();
+ typeName = contents[3];
- Icon = rawContents[4].Trim();
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ Icon = contents[4];
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0