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/PyTaskConfig.cs | 62 ++++++++++++++++---------------
1 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/Core/GameEngine/Model/Config/PyTaskConfig.cs b/Core/GameEngine/Model/Config/PyTaskConfig.cs
index 3e141af..fe37076 100644
--- a/Core/GameEngine/Model/Config/PyTaskConfig.cs
+++ b/Core/GameEngine/Model/Config/PyTaskConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: 绗簩涓栫晫
-// [ Date ]: Saturday, January 06, 2018
+// [ Date ]: Tuesday, February 12, 2019
//--------------------------------------------------------
using UnityEngine;
@@ -11,56 +11,58 @@
public partial class PyTaskConfig : ConfigBase {
- public string id { get ; private set; }
- public string name { get ; private set; }
- public int type { get ; private set ; }
- public int npcId { get ; private set ; }
- public int lv { get ; private set ; }
- public int colorLV { get ; private set ; }
- public int isCanDelete { get ; private set ; }
- public string descList { get ; private set; }
- public string rewardList { get ; private set; }
- public string lightList { get ; private set; }
- public string infoList { get ; private set; }
- public string guideDesc { get ; private set; }
- public int isShowGuideReward { get ; private set ; }
- public string szDayCount { get ; private set; }
+ public string id;
+ public string name;
+ public int type;
+ public int npcId;
+ public int lv;
+ public int colorLV;
+ public int isCanDelete;
+ public string descList;
+ public string rewardList;
+ public string lightList;
+ public string infoList;
+ public string guideDesc;
+ public int isShowGuideReward;
+ public string szDayCount;
public override string getKey()
{
return id.ToString();
}
- public override void Parse() {
+ public override void Parse(string content) {
try
{
- id = rawContents[0].Trim();
+ var contents = content.Split('\t');
+
+ id = contents[0];
- name = rawContents[1].Trim();
+ name = contents[1];
- type=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out type);
- npcId=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out npcId);
- lv=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out lv);
- colorLV=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
+ int.TryParse(contents[5],out colorLV);
- isCanDelete=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0;
+ int.TryParse(contents[6],out isCanDelete);
- descList = rawContents[7].Trim();
+ descList = contents[7];
- rewardList = rawContents[8].Trim();
+ rewardList = contents[8];
- lightList = rawContents[9].Trim();
+ lightList = contents[9];
- infoList = rawContents[10].Trim();
+ infoList = contents[10];
- guideDesc = rawContents[11].Trim();
+ guideDesc = contents[11];
- isShowGuideReward=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0;
+ int.TryParse(contents[12],out isShowGuideReward);
- szDayCount = rawContents[13].Trim();
+ szDayCount = contents[13];
}
catch (Exception ex)
{
--
Gitblit v1.8.0