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/mapAreaConfig.cs | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/Core/GameEngine/Model/Config/mapAreaConfig.cs b/Core/GameEngine/Model/Config/mapAreaConfig.cs
index 85d8035..6472cdf 100644
--- a/Core/GameEngine/Model/Config/mapAreaConfig.cs
+++ b/Core/GameEngine/Model/Config/mapAreaConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: 绗簩涓栫晫
-// [ Date ]: Saturday, January 06, 2018
+// [ Date ]: Tuesday, February 12, 2019
//--------------------------------------------------------
using UnityEngine;
@@ -11,35 +11,37 @@
public partial class mapAreaConfig : ConfigBase {
- public int AreaID { get ; private set ; }
- public int MapID { get ; private set ; }
- public int StartPosX { get ; private set ; }
- public int StartPosY { get ; private set ; }
- public int EndPosX { get ; private set ; }
- public int EndPosY { get ; private set ; }
- public int AreaName { get ; private set ; }
+ public int AreaID;
+ public int MapID;
+ public int StartPosX;
+ public int StartPosY;
+ public int EndPosX;
+ public int EndPosY;
+ public int AreaName;
public override string getKey()
{
return AreaID.ToString();
}
- public override void Parse() {
+ public override void Parse(string content) {
try
{
- AreaID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out AreaID);
- MapID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
+ int.TryParse(contents[1],out MapID);
- StartPosX=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out StartPosX);
- StartPosY=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out StartPosY);
- EndPosX=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out EndPosX);
- EndPosY=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
+ int.TryParse(contents[5],out EndPosY);
- AreaName=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0;
+ int.TryParse(contents[6],out AreaName);
}
catch (Exception ex)
{
--
Gitblit v1.8.0