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/HorseConfig.cs | 140 +++++++++++++++++++++++-----------------------
1 files changed, 71 insertions(+), 69 deletions(-)
diff --git a/Core/GameEngine/Model/Config/HorseConfig.cs b/Core/GameEngine/Model/Config/HorseConfig.cs
index 4afc506..5c83667 100644
--- a/Core/GameEngine/Model/Config/HorseConfig.cs
+++ b/Core/GameEngine/Model/Config/HorseConfig.cs
@@ -1,91 +1,93 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Thursday, October 25, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class HorseConfig : ConfigBase {
-
- public int HorseID { get ; private set ; }
- public int ItemID { get ; private set ; }
- public string Name { get ; private set; }
- public int UnlockItemID { get ; private set ; }
- public int UnlockItemCnt { get ; private set ; }
- public int InitLV { get ; private set ; }
- public int MaxLV { get ; private set ; }
- public int UseNeedRank { get ; private set ; }
- public int Model { get ; private set ; }
- public string IconKey { get ; private set; }
- public int ActionType { get ; private set ; }
- public int Quality { get ; private set ; }
- public int InitFightPower { get ; private set ; }
- public int ShowFightPower { get ; private set ; }
- public int Sort { get ; private set ; }
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class HorseConfig : ConfigBase {
+
+ public int HorseID;
+ public int ItemID;
+ public string Name;
+ public int UnlockItemID;
+ public int UnlockItemCnt;
+ public int InitLV;
+ public int MaxLV;
+ public int UseNeedRank;
+ public int Model;
+ public string IconKey;
+ public int ActionType;
+ public int Quality;
+ public int InitFightPower;
+ public int ShowFightPower;
+ public int Sort;
public int[] RideAudios;
- public string DescribeIconKey { get ; private set; }
-
- public override string getKey()
- {
- return HorseID.ToString();
- }
-
- public override void Parse() {
- try
- {
- HorseID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ public string DescribeIconKey;
+
+ public override string getKey()
+ {
+ return HorseID.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out HorseID);
- ItemID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out ItemID);
- Name = rawContents[2].Trim();
+ Name = contents[2];
- UnlockItemID=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out UnlockItemID);
- UnlockItemCnt=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out UnlockItemCnt);
- InitLV=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
+ int.TryParse(contents[5],out InitLV);
- MaxLV=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0;
+ int.TryParse(contents[6],out MaxLV);
- UseNeedRank=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0;
+ int.TryParse(contents[7],out UseNeedRank);
- Model=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0;
+ int.TryParse(contents[8],out Model);
- IconKey = rawContents[9].Trim();
+ IconKey = contents[9];
- ActionType=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0;
+ int.TryParse(contents[10],out ActionType);
- Quality=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0;
+ int.TryParse(contents[11],out Quality);
- InitFightPower=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0;
+ int.TryParse(contents[12],out InitFightPower);
- ShowFightPower=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0;
+ int.TryParse(contents[13],out ShowFightPower);
- Sort=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0;
+ int.TryParse(contents[14],out Sort);
- string[] RideAudiosStringArray = rawContents[15].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var RideAudiosStringArray = contents[15].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
RideAudios = new int[RideAudiosStringArray.Length];
for (int i=0;i<RideAudiosStringArray.Length;i++)
{
int.TryParse(RideAudiosStringArray[i],out RideAudios[i]);
}
- DescribeIconKey = rawContents[16].Trim();
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ DescribeIconKey = contents[16];
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0