| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Collections.Generic;
- using ET;
- using FairyGUI;
- using UnityEngine;
- namespace GFGGame
- {
- public class TravelDataManager : SingletonBase<TravelDataManager>
- {
- public TravelData TravelData { get; set; }
- public List<int> ListTravelLocationCount = new List<int>();//下标对应TravelLoactionCfg表格id
- public List<int> ListTravelAreaRewardState = new List<int>();//下标对应TravelGuide表格id
- public void Clear()
- {
- TravelData = null;
- ListTravelLocationCount.Clear();
- ListTravelAreaRewardState.Clear();
- }
- public int GetTravelIndexByLocationId(int locationId)
- {
- for (int i = 0; i < CommonDataManager.Tables.TblTravelLoactionCfg.DataList.Count; i++)
- {
- if (CommonDataManager.Tables.TblTravelLoactionCfg.DataList[i].Id == locationId)
- {
- return i;
- }
- }
- return -1;
- }
- public int GetTravelCountByLocationId(int locationId)
- {
- if (ListTravelLocationCount.Count == 0) return 0;
- int index = GetTravelIndexByLocationId(locationId);
- return ListTravelLocationCount[index];
- }
- public int GetGuideIndexByAreaId(int areaId)
- {
- for (int i = 0; i < CommonDataManager.Tables.TblTravelGuideCfg.DataList.Count ; i++)
- {
- if (CommonDataManager.Tables.TblTravelGuideCfg.DataList[i].Id == areaId)
- {
- return i;
- }
- }
- return -1;
- }
- public int GetGuideRewardStateByAreaId(int areaId)
- {
- if (ListTravelAreaRewardState.Count == 0) return ConstBonusStatus.CAN_NOT_GET;
- int index = GetGuideIndexByAreaId(areaId);
- return TravelDataManager.Instance.ListTravelAreaRewardState[index];
- }
- public void GetTotalTravelProgress(out int count, out int totalCount)
- {
- totalCount = 1;
- count = 0;
- if (ListTravelLocationCount == null) return;
- for (int i = 0; i < ListTravelLocationCount.Count; i++)
- {
- if (ListTravelLocationCount[i] > 0)
- {
- count++;
- }
- }
- totalCount = ListTravelLocationCount.Count;
- }
- }
- }
|