public void Apply(RankData rankdata, List <SimplifiedPlayerInfo> playerlist) { int k = 1; foreach (var player in playerlist) { var bar = new UIRankBoardPlayerBar(player, k++); _onlinePlayerList.Add(bar); } seasonEndTime = rankdata.RankSeasonEndTime; }
public void RefreshBoard() { _onlinePlayerList.Clear(); if (Main.netMode == 1) { MessageSender.SendRequestRankBoard(); } else { List <SimplifiedPlayerInfo> list = new List <SimplifiedPlayerInfo>(); for (var i = 0; i < 20; i++) { var testinfo = new SimplifiedPlayerInfo() { Name = ServerUtils.RandomGenString(), Rank = Main.rand.Next(1000) + 1000, KillCount = Main.rand.Next(100), IsFriend = true, }; list.Add(testinfo); } list.Sort(SimplifiedPlayerInfo.CompareB); list.Reverse(); int k = 1; foreach (var info in list) { var bar = new UIRankBoardPlayerBar(info, k); _onlinePlayerList.Add(bar); k++; } seasonEndTime = DateTime.Now.AddDays(5); } _relaxTimer = 180; _rotation = 0f; }