12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using System.Collections.Generic;
- using ET;
- namespace GFGGame
- {
- public class LeagueDataManager : SingletonBase<LeagueDataManager>
- {
- public int Type = 2;// 1:已经加入军团 2:未加入军团
- public LeagueData LeagueData;//联盟信息
- public int HallLevel { get { return (int)GetNumeriValue(LeagueNumericType.HallLevel); } }
- public int HotelLevel { get { return (int)GetNumeriValue(LeagueNumericType.HotelLevel); } }
- public int StoreLevel { get { return (int)GetNumeriValue(LeagueNumericType.StoreLevel); } }
- public Dictionary<int, long> LeagueNumber = new Dictionary<int, long>();//联盟数值
- public Dictionary<long, LeagueListData> ListDatas = new Dictionary<long, LeagueListData>();//联盟列表
- public Dictionary<long, OtherRoleInfoData> ListApplyDatas = new Dictionary<long, OtherRoleInfoData>();//联盟申请列表
- public List<LeagueLogData> ListLogDatas = new List<LeagueLogData>();//日志数据
- public Dictionary<long, int> ListAnswerDatas = new Dictionary<long, int>();//答题数据
- public void Clear()
- {
- Type = 2;
- ListDatas.Clear();
- LeagueData = null;
- ListApplyDatas.Clear();
- ListLogDatas.Clear();
- }
- public void SetNumeric(int type, long value)
- {
- LeagueNumber[type] = value;
- }
- public long GetNumeriValue(int type)
- {
- if (LeagueNumber.TryGetValue(type, out long value))
- {
- return value;
- }
- return 0;
- }
- public string GetMemberTitle(int pos)
- {
- string title = "";
- switch (pos)
- {
- case LeaguePos.Owner:
- title = "社长";
- break;
- case LeaguePos.SubOwner:
- title = "副社长";
- break;
- case LeaguePos.Flower:
- title = "御史";
- break;
- case LeaguePos.Member:
- title = "成员";
- break;
- }
- return title;
- }
- public int GetMyPos()
- {
- if (LeagueDataManager.Instance.LeagueData.LeagueMemberDatas.TryGetValue(RoleDataManager.roleId, out LeagueMemberData memberData))
- {
- return memberData.Pos;
- }
- return LeaguePos.Member;
- }
- // //判断一个玩家是否是会长副会长
- // public bool CheckPlayerIsLeader()
- // {
- // }
- /// <summary>
- /// 根据祈福类型获取祈福次数
- /// </summary>
- /// <returns></returns>
- public int GetPrayTimesByType(int prayType)
- {
- int curCount = 0;
- switch (prayType)
- {
- case LeaguePrayType.First:
- curCount = RoleDataManager.LeagueType1PrayTimes;
- break;
- case LeaguePrayType.Second:
- curCount = RoleDataManager.LeagueType2PrayTimes;
- break;
- case LeaguePrayType.Third:
- curCount = RoleDataManager.LeagueType3PrayTimes;
- break;
- }
- return curCount;
- }
- }
- }
|