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/MapEventPointConfig.cs | 54 ++++++++++++++++++++++++++++--------------------------
1 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/Core/GameEngine/Model/Config/MapEventPointConfig.cs b/Core/GameEngine/Model/Config/MapEventPointConfig.cs
index 71b2b7b..3ec5ddd 100644
--- a/Core/GameEngine/Model/Config/MapEventPointConfig.cs
+++ b/Core/GameEngine/Model/Config/MapEventPointConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: 绗簩涓栫晫
-// [ Date ]: Sunday, April 08, 2018
+// [ Date ]: Tuesday, February 12, 2019
//--------------------------------------------------------
using UnityEngine;
@@ -11,50 +11,52 @@
public partial class MapEventPointConfig : ConfigBase {
- public int Key { get ; private set ; }
- public int MapID { get ; private set ; }
- public int NPCID { get ; private set ; }
- public int IsShowInfo { get ; private set ; }
- public int ShowInMipMap { get ; private set ; }
- public int Colour { get ; private set ; }
- public int LowLV { get ; private set ; }
- public int HighestLV { get ; private set ; }
- public int Defense { get ; private set ; }
- public string Drop1 { get ; private set; }
- public string Drop2 { get ; private set; }
- public string EXP { get ; private set; }
+ public int Key;
+ public int MapID;
+ public int NPCID;
+ public int IsShowInfo;
+ public int ShowInMipMap;
+ public int Colour;
+ public int LowLV;
+ public int HighestLV;
+ public int Defense;
+ public string Drop1;
+ public string Drop2;
+ public string EXP;
public override string getKey()
{
return Key.ToString();
}
- public override void Parse() {
+ public override void Parse(string content) {
try
{
- Key=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out Key);
- MapID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out MapID);
- NPCID=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out NPCID);
- IsShowInfo=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out IsShowInfo);
- ShowInMipMap=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out ShowInMipMap);
- Colour=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
+ int.TryParse(contents[5],out Colour);
- LowLV=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0;
+ int.TryParse(contents[6],out LowLV);
- HighestLV=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0;
+ int.TryParse(contents[7],out HighestLV);
- Defense=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0;
+ int.TryParse(contents[8],out Defense);
- Drop1 = rawContents[9].Trim();
+ Drop1 = contents[9];
- Drop2 = rawContents[10].Trim();
+ Drop2 = contents[10];
- EXP = rawContents[11].Trim();
+ EXP = contents[11];
}
catch (Exception ex)
{
--
Gitblit v1.8.0