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/ChatBubbleBoxConfig.cs | 116 +++++++++++++++++++++++++++++----------------------------
1 files changed, 59 insertions(+), 57 deletions(-)
diff --git a/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs b/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs
index a799bb7..1945538 100644
--- a/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs
+++ b/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs
@@ -1,86 +1,88 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Wednesday, November 07, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
- public partial class ChatBubbleBoxConfig : ConfigBase {
-
- public int ID { get ; private set ; }
- public string Name { get ; private set; }
- public int NeedLV { get ; private set ; }
- public string leftBubbleIcon { get ; private set; }
- public string rightBubbleIcon { get ; private set; }
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
+ public partial class ChatBubbleBoxConfig : ConfigBase {
+
+ public int ID;
+ public string Name;
+ public int NeedLV;
+ public string leftBubbleIcon;
+ public string rightBubbleIcon;
public int[] leftOffset;
public int[] rightOffset;
- public string Icon { get ; private set; }
- public int Jump { get ; private set ; }
- public string GainTip { get ; private set; }
+ public string Icon;
+ public int Jump;
+ public string GainTip;
public int[] color;
- public int top { get ; private set ; }
-
- public override string getKey()
- {
- return ID.ToString();
- }
-
- public override void Parse() {
- try
- {
- ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ public int top;
+
+ public override string getKey()
+ {
+ return ID.ToString();
+ }
+
+ public override void Parse(string content) {
+ try
+ {
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out ID);
- Name = rawContents[1].Trim();
+ Name = contents[1];
- NeedLV=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
+ int.TryParse(contents[2],out NeedLV);
- leftBubbleIcon = rawContents[3].Trim();
+ leftBubbleIcon = contents[3];
- rightBubbleIcon = rawContents[4].Trim();
+ rightBubbleIcon = contents[4];
- string[] leftOffsetStringArray = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var leftOffsetStringArray = contents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
leftOffset = new int[leftOffsetStringArray.Length];
for (int i=0;i<leftOffsetStringArray.Length;i++)
{
int.TryParse(leftOffsetStringArray[i],out leftOffset[i]);
}
- string[] rightOffsetStringArray = rawContents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var rightOffsetStringArray = contents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
rightOffset = new int[rightOffsetStringArray.Length];
for (int i=0;i<rightOffsetStringArray.Length;i++)
{
int.TryParse(rightOffsetStringArray[i],out rightOffset[i]);
}
- Icon = rawContents[7].Trim();
+ Icon = contents[7];
- Jump=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0;
+ int.TryParse(contents[8],out Jump);
- GainTip = rawContents[9].Trim();
+ GainTip = contents[9];
- string[] colorStringArray = rawContents[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ var colorStringArray = contents[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
color = new int[colorStringArray.Length];
for (int i=0;i<colorStringArray.Length;i++)
{
int.TryParse(colorStringArray[i],out color[i]);
}
- top=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0;
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ int.TryParse(contents[11],out top);
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0