using FairyGUI; using ET; using System.Collections.Generic; using System; namespace GFGGame { public class RoleInfoManager : SingletonBase { private List _headDatas = new List() { 5000001, 5000002, 5000003 }; public List headDatas { get { SortHeadDatas(); return _headDatas; } } private List _headBorderDatas = new List() { 5005001, 5005002, 5005003, 5005001, 5005002, 5005003, 5005001, 5005002, 5005003, 5005001, 5005002, 5005003 }; public List headBorderDatas { get { SortHeadBorderDatas(); return _headBorderDatas; } } public List photoDatas = new List() { 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; } } }