| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Monday, November 06, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Collections.Generic; |
| | | //用于任务分配 |
| | | namespace Snxxz.UI { |
| | | |
| | | public class TaskAllocation:Singleton<TaskAllocation> { |
| | | |
| | | private static StringBuilder textBuilder = new StringBuilder(); |
| | | private const string Info_Pattern = "{([a-zA-Z0-9_]+)}"; |
| | | PlayerTaskDatas m_TaskModel; |
| | | PlayerTaskDatas taskmodel |
| | | { |
| | | get |
| | | { |
| | | return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); |
| | | } |
| | | } |
| | | public string GetTaskInfo(string val, int _item)//用于0820中字典的值替换(1字符串2任务ID) |
| | | { |
| | | textBuilder.Length = 0; |
| | | int index = 0; |
| | | if (Regex.IsMatch(val, Info_Pattern)) |
| | | { |
| | | if (taskmodel.ReplaceDic.ContainsKey(_item)) |
| | | { |
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[_item]; |
| | | foreach (Match match in Regex.Matches(val, Info_Pattern)) |
| | | { |
| | | textBuilder.Append(val.Substring(index, match.Index - index)); |
| | | if (_dic.ContainsKey(match.Groups[1].Value)) |
| | | { |
| | | textBuilder.Append(_dic[match.Groups[1].Value]); |
| | | } |
| | | else |
| | | { |
| | | textBuilder.Append(0); |
| | | } |
| | | |
| | | index = match.Index + match.Length; |
| | | } |
| | | } |
| | | textBuilder.Append(val.Substring(index, val.Length - index)); |
| | | return textBuilder.ToString(); |
| | | } |
| | | else |
| | | { |
| | | return val; |
| | | } |
| | | } |
| | | |
| | | public int ForRingNumber()//获取赏金环数 |
| | | { |
| | | if (taskmodel.ReplaceDic.ContainsKey(1)) |
| | | { |
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1]; |
| | | if (_dic.ContainsKey("around_count")) |
| | | { |
| | | string str = "around_count"; |
| | | return _dic[str]; |
| | | |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | public int ForRingAllNumber()//获取赏金总环数 |
| | | { |
| | | if (taskmodel.ReplaceDic.ContainsKey(1)) |
| | | { |
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1]; |
| | | if (_dic.ContainsKey("around_allcount")) |
| | | { |
| | | string str = "around_allcount"; |
| | | return _dic[str]; |
| | | |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int FairyAuNumber()//获取仙盟环数 |
| | | { |
| | | if (taskmodel.ReplaceDic.ContainsKey(1)) |
| | | { |
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1]; |
| | | if (_dic.ContainsKey("around_count_family")) |
| | | { |
| | | string str = "around_count_family"; |
| | | return _dic[str]; |
| | | |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int FairyAuAllNumber()//获取仙盟总环数 |
| | | { |
| | | if (taskmodel.ReplaceDic.ContainsKey(1)) |
| | | { |
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1]; |
| | | if (_dic.ContainsKey("around_allcount_family")) |
| | | { |
| | | string str = "around_allcount_family"; |
| | | return _dic[str]; |
| | | |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, November 06, 2017
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using System.Text;
|
| | | using System.Text.RegularExpressions;
|
| | | using System.Collections.Generic;
|
| | | //用于任务分配
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class TaskAllocation:Singleton<TaskAllocation> {
|
| | |
|
| | | private static StringBuilder textBuilder = new StringBuilder();
|
| | | private const string Info_Pattern = "{([a-zA-Z0-9_]+)}";
|
| | | PlayerTaskDatas m_TaskModel;
|
| | | PlayerTaskDatas taskmodel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>());
|
| | | }
|
| | | }
|
| | | public string GetTaskInfo(string val, int _item)//用于0820中字典的值替换(1字符串2任务ID)
|
| | | {
|
| | | textBuilder.Length = 0;
|
| | | int index = 0;
|
| | | if (Regex.IsMatch(val, Info_Pattern))
|
| | | {
|
| | | if (taskmodel.ReplaceDic.ContainsKey(_item))
|
| | | {
|
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[_item];
|
| | | foreach (Match match in Regex.Matches(val, Info_Pattern))
|
| | | {
|
| | | textBuilder.Append(val.Substring(index, match.Index - index));
|
| | | if (_dic.ContainsKey(match.Groups[1].Value))
|
| | | {
|
| | | textBuilder.Append(_dic[match.Groups[1].Value]);
|
| | | }
|
| | | else
|
| | | {
|
| | | textBuilder.Append(0);
|
| | | }
|
| | |
|
| | | index = match.Index + match.Length;
|
| | | }
|
| | | }
|
| | | textBuilder.Append(val.Substring(index, val.Length - index));
|
| | | return textBuilder.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | return val;
|
| | | }
|
| | | }
|
| | |
|
| | | public int ForRingNumber()//获取赏金环数
|
| | | {
|
| | | if (taskmodel.ReplaceDic.ContainsKey(1))
|
| | | {
|
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1];
|
| | | if (_dic.ContainsKey("around_count"))
|
| | | {
|
| | | string str = "around_count";
|
| | | return _dic[str];
|
| | |
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | public int ForRingAllNumber()//获取赏金总环数
|
| | | {
|
| | | if (taskmodel.ReplaceDic.ContainsKey(1))
|
| | | {
|
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1];
|
| | | if (_dic.ContainsKey("around_allcount"))
|
| | | {
|
| | | string str = "around_allcount";
|
| | | return _dic[str];
|
| | |
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public int FairyAuNumber()//获取仙盟环数
|
| | | {
|
| | | if (taskmodel.ReplaceDic.ContainsKey(1))
|
| | | {
|
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1];
|
| | | if (_dic.ContainsKey("around_count_family"))
|
| | | {
|
| | | string str = "around_count_family";
|
| | | return _dic[str];
|
| | |
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public int FairyAuAllNumber()//获取仙盟总环数
|
| | | {
|
| | | if (taskmodel.ReplaceDic.ContainsKey(1))
|
| | | {
|
| | | Dictionary<string, int> _dic = taskmodel.ReplaceDic[1];
|
| | | if (_dic.ContainsKey("around_allcount_family"))
|
| | | {
|
| | | string str = "around_allcount_family";
|
| | | return _dic[str];
|
| | |
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|