123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using FairyGUI;
- using ET;
- using System.Collections.Generic;
- using System;
- namespace GFGGame
- {
- public class RoleInfoManager : SingletonBase<RoleInfoManager>
- {
- private List<int> _headDatas = new List<int>() { 5000001, 5000002, 5000003 };
- public List<int> headDatas
- {
- get
- {
- SortHeadDatas();
- return _headDatas;
- }
- }
- private List<int> _headBorderDatas = new List<int>() { 5005001, 5005002, 5005003, 5005001, 5005002, 5005003, 5005001, 5005002, 5005003, 5005001, 5005002, 5005003 };
- public List<int> headBorderDatas
- {
- get
- {
- SortHeadBorderDatas();
- return _headBorderDatas;
- }
- }
- public List<long> photoDatas = new List<long>() { 0, 0, 0, 0 };
- public void Clear()
- {
- _headDatas.Clear();
- _headBorderDatas.Clear();
- }
- public void Add(int itemId)
- {
- ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
- if (cfg.subType == 0)
- {
- if (_headDatas.IndexOf(itemId) < 0) _headDatas.Add(itemId);
- }
- else if (cfg.subType == 1)
- {
- if (_headBorderDatas.IndexOf(itemId) < 0) _headBorderDatas.Add(itemId);
- }
- }
- public void Remove(int itemId)
- {
- ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
- if (cfg.subType == 0)
- {
- if (_headDatas.IndexOf(itemId) >= 0) _headDatas.Remove(itemId);
- }
- else if (cfg.subType == 1)
- {
- if (_headBorderDatas.IndexOf(itemId) >= 0) _headBorderDatas.Remove(itemId);
- }
- }
- private void SortHeadDatas()
- {
- _headDatas.Sort((int a, int b) =>
- {
- return b - a;
- });
- }
- private void SortHeadBorderDatas()
- {
- _headBorderDatas.Sort((int a, int b) =>
- {
- return b - a;
- });
- }
- public decimal GetGuideProgress()
- {
- int suitHaveCount = 0;
- int suitTotalCount = 1;
- DressUpMenuSuitDataManager.GetTotalProgress(out suitHaveCount, out suitTotalCount);
- int chapterItemHaveCount = 0;
- int chapterItemTotalCount = 1;
- InstanceZonesDataManager.GetTotalProgress(out chapterItemHaveCount, out chapterItemTotalCount);
- int travelHaveCount = 0;
- int travelTotalCount = 1;
- TravelDataManager.Instance.GetTotalTravelProgress(out travelHaveCount, out travelTotalCount);
- int haveCount = suitHaveCount + chapterItemHaveCount + travelHaveCount;
- int totalCount = suitTotalCount + chapterItemTotalCount + travelTotalCount;
- decimal value = Math.Floor((decimal)100 * haveCount / totalCount);
- return value;
- }
- }
- }
|