|
@@ -2,30 +2,100 @@ using System.Collections.Generic;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
+ public struct FieldInfos
|
|
|
+ {
|
|
|
+ public int theme;
|
|
|
+ public List<int> highestLvls;
|
|
|
+ public int bonusWeekly;
|
|
|
+ public int bonusMaxLimit;
|
|
|
+ public Dictionary<int, int> taskDic;
|
|
|
+ public bool hasBonus;
|
|
|
+ };
|
|
|
+ public struct FieldResult
|
|
|
+ {
|
|
|
+ public int passLvl;//完成关数
|
|
|
+ public List<ItemData> bonusList;
|
|
|
+ public int costNum; //体力消耗
|
|
|
+ public int hardLvl; //难度,由ConstInstanceZonesSubType定义
|
|
|
+
|
|
|
+ }
|
|
|
public class FieldDataManager : SingletonBase<FieldDataManager>
|
|
|
{
|
|
|
- /// <summary>
|
|
|
- /// 本期主题
|
|
|
- /// </summary>
|
|
|
- public int scoreType = 1;
|
|
|
- public Dictionary<int, int> _levelIdDic = new Dictionary<int, int>();
|
|
|
- private Dictionary<int, int> _taskDic = new Dictionary<int, int>();
|
|
|
+ // private int _theme = 1; //当前主题 由ConstItemAttributeType定义
|
|
|
+ // /// <summary>
|
|
|
+ // /// 本期主题
|
|
|
+ // /// </summary>
|
|
|
+ // public int Theme
|
|
|
+ // {
|
|
|
+ // get { return _theme; }
|
|
|
+ // set { _theme = value; }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private int _bonusWeekly = 0;//每周已领奖励
|
|
|
+ // /// <summary>
|
|
|
+ // /// 每周已领奖励
|
|
|
+ // /// </summary>
|
|
|
+ // /// <value></value>
|
|
|
+ // public int BonusWeekly
|
|
|
+ // {
|
|
|
+ // get { return _bonusWeekly; }
|
|
|
+ // set { _bonusWeekly = value; }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private int _bonusMaxLimit = 0;//奖励上限
|
|
|
+ // /// <summary>
|
|
|
+ // /// 奖励上限
|
|
|
+ // /// </summary>
|
|
|
+ // /// <value></value>
|
|
|
+ // public int BonusMaxLimit
|
|
|
+ // {
|
|
|
+ // get { return _bonusMaxLimit; }
|
|
|
+ // set { _bonusMaxLimit = value; }
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // private List<int> _highestLvls = new List<int>();//最高关卡记录列表,由简单到难
|
|
|
+ // private Dictionary<int, int> _taskDic = new Dictionary<int, int>();//任务奖励状态 由ConstBonusStatus定义
|
|
|
+ // private bool hasBonus = false;//仅在上线时判断是否有奖励未结算
|
|
|
+
|
|
|
+
|
|
|
+ public FieldInfos fieldInfos = new FieldInfos();
|
|
|
+ public FieldResult fieldResult = new FieldResult();
|
|
|
|
|
|
/// <summary>
|
|
|
/// 当前难度
|
|
|
/// </summary>
|
|
|
- public int difficulty = 0;
|
|
|
-
|
|
|
+ public int c_difficulty = 0;
|
|
|
|
|
|
+ // public void UpdateHighestLvls(List<int> highestLvls)
|
|
|
+ // {
|
|
|
+ // _highestLvls = highestLvls;
|
|
|
+ // }
|
|
|
public void UpdateTask(int taskId, int state)
|
|
|
{
|
|
|
- if (!_taskDic.ContainsKey(taskId))
|
|
|
+ if (!fieldInfos.taskDic.ContainsKey(taskId))
|
|
|
{
|
|
|
- _taskDic.Add(taskId, state);
|
|
|
+ fieldInfos.taskDic.Add(taskId, state);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- _taskDic[taskId] = state;
|
|
|
+ fieldInfos.taskDic[taskId] = state;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 根据挑战难度获取最高记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="difficulty"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public int GetHighestLvByDifficulty(int difficulty)
|
|
|
+ {
|
|
|
+ if (fieldInfos.highestLvls.IndexOf(difficulty) < 0)
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return fieldInfos.highestLvls[difficulty];
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -44,15 +114,8 @@ namespace GFGGame
|
|
|
/// <returns></returns>
|
|
|
public int GetLevelIdByDifficulty(int difficulty)
|
|
|
{
|
|
|
- if (_levelIdDic.ContainsKey(difficulty))
|
|
|
- {
|
|
|
- return _levelIdDic[difficulty];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- FieldCfg cfg = GetFieldCfgByDifficulty(difficulty);
|
|
|
- return StoryLevelCfgArray.Instance.GetCfgs(cfg.type, cfg.subType, cfg.id)[0].id;
|
|
|
- }
|
|
|
+ FieldCfg cfg = GetFieldCfgByDifficulty(difficulty);
|
|
|
+ return StoryLevelCfgArray.Instance.GetCfgs(cfg.type, cfg.subType, cfg.id)[0].id;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取任务列表
|
|
@@ -78,7 +141,7 @@ namespace GFGGame
|
|
|
/// <returns></returns>
|
|
|
public int GetTaskState(int taskId)
|
|
|
{
|
|
|
- return _taskDic.ContainsKey(taskId) ? _taskDic[taskId] : 1;
|
|
|
+ return fieldInfos.taskDic.ContainsKey(taskId) ? fieldInfos.taskDic[taskId] : 1;
|
|
|
}
|
|
|
}
|
|
|
}
|