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/JadeDynastyBossConfig.cs | 108 +++++++++++++++++++++++++++--------------------------
1 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs b/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs
index 5237c74..f7049bd 100644
--- a/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs
+++ b/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs
@@ -1,67 +1,69 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Thursday, January 31, 2019
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class JadeDynastyBossConfig : ConfigBase {
-
- public int NPCID { get ; private set ; }
- public int LineID { get ; private set ; }
- public int Time { get ; private set ; }
- public int RealmLV { get ; private set ; }
- public int ZhuXianScore { get ; private set ; }
- public string dropItems { get ; private set; }
- public string PortraitID { get ; private set; }
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class JadeDynastyBossConfig : ConfigBase {
+
+ public int NPCID;
+ public int LineID;
+ public int Time;
+ public int RealmLV;
+ public int ZhuXianScore;
+ public string dropItems;
+ public string PortraitID;
public int[] conditionSorts;
- public int AutoAttention { get ; private set ; }
-
- public override string getKey()
- {
- return NPCID.ToString();
- }
-
- public override void Parse() {
- try
- {
- NPCID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ public int AutoAttention;
+
+ public override string getKey()
+ {
+ return NPCID.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out NPCID);
- LineID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out LineID);
- Time=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out Time);
- RealmLV=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out RealmLV);
- ZhuXianScore=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out ZhuXianScore);
- dropItems = rawContents[5].Trim();
+ dropItems = contents[5];
- PortraitID = rawContents[6].Trim();
+ PortraitID = contents[6];
- string[] conditionSortsStringArray = rawContents[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var conditionSortsStringArray = contents[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
conditionSorts = new int[conditionSortsStringArray.Length];
for (int i=0;i<conditionSortsStringArray.Length;i++)
{
int.TryParse(conditionSortsStringArray[i],out conditionSorts[i]);
}
- AutoAttention=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0;
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ int.TryParse(contents[8],out AutoAttention);
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0