Esempio n. 1
0
        private async void ParseTeams(JToken token)
        {
            teams.Clear();
            foreach (var teamToken in token)
            {
                var team = ArmyTeam.Parse(teamToken, infoModel.ServerTime);
                teams.Add(team);
                if (!findInList(team.Name))
                {
                    if (team.Condition.Equals(" cấp 0 trở lên") && this.chkAutoJoin.Checked &&
                        !isJoinning && team.PlayerCount < 8 && mcuModel.McuCooldown == 0)
                    {
                        await packetWriter.JoinArmyAsync(team.Id);
                    }
                }
            }

            if (this.chkAutoPt.Checked && !isCreating && mcuModel.McuCooldown == 0)
            {
                createArmy();
            }

            var oldSelectedIndex = teamList.SelectedIndex;

            teamList.SetObjects(teams, true);
            teamList.SelectedIndex = oldSelectedIndex;
        }