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/GodWeaponConfig.cs | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/Core/GameEngine/Model/Config/GodWeaponConfig.cs b/Core/GameEngine/Model/Config/GodWeaponConfig.cs
index 87de20e..6711e69 100644
--- a/Core/GameEngine/Model/Config/GodWeaponConfig.cs
+++ b/Core/GameEngine/Model/Config/GodWeaponConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: 绗簩涓栫晫
-// [ Date ]: Saturday, January 06, 2018
+// [ Date ]: Tuesday, February 12, 2019
//--------------------------------------------------------
using UnityEngine;
@@ -11,48 +11,50 @@
public partial class GodWeaponConfig : ConfigBase {
- public int ID { get ; private set ; }
- public int Type { get ; private set ; }
- public string Name { get ; private set; }
- public int Lv { get ; private set ; }
- public int NeedExp { get ; private set ; }
+ public int ID;
+ public int Type;
+ public string Name;
+ public int Lv;
+ public int NeedExp;
public int[] AttrType;
public int[] AttrNum;
- public int SkillID { get ; private set ; }
+ public int SkillID;
public override string getKey()
{
return ID.ToString();
}
- public override void Parse() {
+ public override void Parse(string content) {
try
{
- ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out ID);
- Type=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out Type);
- Name = rawContents[2].Trim();
+ Name = contents[2];
- Lv=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out Lv);
- NeedExp=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out NeedExp);
- string[] AttrTypeStringArray = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var AttrTypeStringArray = contents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
AttrType = new int[AttrTypeStringArray.Length];
for (int i=0;i<AttrTypeStringArray.Length;i++)
{
int.TryParse(AttrTypeStringArray[i],out AttrType[i]);
}
- string[] AttrNumStringArray = rawContents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var AttrNumStringArray = contents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
AttrNum = new int[AttrNumStringArray.Length];
for (int i=0;i<AttrNumStringArray.Length;i++)
{
int.TryParse(AttrNumStringArray[i],out AttrNum[i]);
}
- SkillID=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0;
+ int.TryParse(contents[7],out SkillID);
}
catch (Exception ex)
{
--
Gitblit v1.8.0