Example #1
0
        private void alliancePreBattlePlayers(object payload)
        {
            Hashtable data        = payload as Hashtable;
            Hashtable data1       = data["allianceWarSettlement"] as Hashtable;
            Hashtable winner      = data1["winner"] as Hashtable;
            Hashtable loser       = data1["loser"] as Hashtable;
            Hashtable winAlliance = data1["winAlliance"] as Hashtable;

            ScoreBoardData winnerData = new ScoreBoardData();

            winnerData.Name        = EB.Localizer.GetString(EB.Dot.String("name", winner, string.Empty));
            winnerData.Score       = EB.Dot.Integer("score", winner, 0);
            winnerData.id          = EB.Dot.Long("uid", winner, 0);
            winnerData.buffID      = EB.Dot.Integer("buff.id", winner, 0);
            winnerData.buffLv      = EB.Dot.Integer("buff.lv", winner, 0);
            winnerData.protectTime = EB.Dot.Integer("protectTime", loser, 0);

            ScoreBoardData loserData = new ScoreBoardData();
            string         nameStr   = EB.Dot.String("name", loser, string.Empty);

            loserData.Name        = string.IsNullOrEmpty(nameStr) ? nameStr : EB.Localizer.GetString(nameStr);
            loserData.Score       = EB.Dot.Integer("score", loser, 0);
            loserData.id          = EB.Dot.Long("uid", loser, 0);
            loserData.buffID      = EB.Dot.Integer("buff.id", loser, 0);
            loserData.buffLv      = EB.Dot.Integer("buff.lv", loser, 0);
            loserData.protectTime = EB.Dot.Integer("protectTime", loser, 0);

            LegionRankData winAllianceData = new LegionRankData();

            winAllianceData.id    = EB.Dot.Integer("id", winAlliance, -1);
            winAllianceData.Score = EB.Dot.Integer("score", winAlliance, 0);
            winAllianceData.Name  = EB.Localizer.GetString(EB.Dot.String("name", winAlliance, string.Empty));
        }
Example #2
0
        private void UpdateLegionRank()
        {
            List <LegionRankData> temp     = LTLegionWarManager.Instance.LegionRankList.LegionRankList;
            List <ScoreBoardData> rankList = SetLegionScoreBoard(temp);
            ScoreBoardData        myRank   = LTLegionWarManager.Instance.LegionRankList.MyLegionRank;

            SetScoreBoard(rankList);
            SetPlayerItem(myRank);
        }
Example #3
0
        private ScoreBoardData changeData(LegionRankData temp)
        {
            ScoreBoardData data = new ScoreBoardData();

            data.Name  = temp.Name;
            data.Rank  = temp.Rank;
            data.Score = temp.Score;
            data.id    = temp.id;
            return(data);
        }
Example #4
0
 private void SetPlayerItem(ScoreBoardData rank)
 {
     if (rank != null && rank.Name != null)
     {
         PlayerItem.mDMono.gameObject.SetActive(true);
         PlayerItem.Fill(rank);
     }
     else
     {
         PlayerItem.mDMono.gameObject.SetActive(false);
     }
 }
Example #5
0
        private List <ScoreBoardData> SetLegionScoreBoard(List <LegionRankData> rankList)
        {
            List <ScoreBoardData> board = new List <ScoreBoardData>();

            for (int i = 0; i < rankList.Count; i++)
            {
                ScoreBoardData data = new ScoreBoardData();
                data.Name  = rankList[i].Name;
                data.Rank  = rankList[i].Rank;
                data.Score = rankList[i].Score;
                board.Add(data);
            }
            return(board);
        }
Example #6
0
        private ScoreBoardData Parse(object value, string Name)
        {
            if (value == null)
            {
                return(null);
            }

            ScoreBoardData item = Find(Name) ?? new ScoreBoardData();

            item.Score = EB.Dot.Integer("score", value, item.Score);
            item.Name  = EB.Localizer.GetString(EB.Dot.String("name", value, item.Name));
            item.id    = EB.Dot.Long("uid", value, 0);
            item.Rank  = EB.Dot.Integer("rank", value, 0);
            return(item);
        }
Example #7
0
        public void OnMerge(object obj)
        {
            CleanUp();
            List <ScoreBoardData> temp = new List <ScoreBoardData>();

            temp = Hotfix_LT.EBCore.Dot.List <ScoreBoardData, string>(null, obj, PersonRankList, Parse, (item, Name) => item.Name == Name);
            for (int i = 0; i < temp.Count - 1; i++)
            {
                temp[i].Rank = i + 1;
                PersonRankList.Add(temp[i]);
            }
            if (temp.Count > 0)
            {
                MyPersonRank = temp[temp.Count - 1];
            }
        }
Example #8
0
        public void OnMerge(object obj)
        {
            CleanUp();
            List <LegionRankData> mList = new List <LegionRankData>();

            mList = Hotfix_LT.EBCore.Dot.List <LegionRankData, int>(null, obj, LegionRankList, Parse, (item, id) => item.id == id);
            for (int i = 0; i < mList.Count - 1; i++)
            {
                if (mList[i].id == 1)
                {
                    continue;
                }
                mList[i].Rank = i + 1;
                LegionRankList.Add(mList[i]);
            }
            if (mList.Count > 0)
            {
                MyLegionRank = changeData(mList[mList.Count - 1]);
            }
        }
Example #9
0
        public ScoreBoardData Find(string Name)
        {
            ScoreBoardData item = PersonRankList.Where(m => m.Name == Name).FirstOrDefault();

            return(item);
        }
Example #10
0
 public void CleanUp()
 {
     MyPersonRank = new ScoreBoardData();
     PersonRankList.Clear();
 }
Example #11
0
 public WarPersonRankList()
 {
     PersonRankList = new List <ScoreBoardData>();
     MyPersonRank   = new ScoreBoardData();
 }
Example #12
0
 public void CleanUp()
 {
     LegionRankList.Clear();
     MyLegionRank = new ScoreBoardData();
 }