Exemple #1
0
        private void OnAddUserParty(UserParty party)
        {
            UserParties.Add(new PartyListElementViewModel(party, OnSelectAttackRoute));
            var parties = UserParties.ToArray();

            UserParties.Clear();
            UserParties.AddRange(parties.OrderByDescending(x => x.Party.Value.CreateTime));
        }
Exemple #2
0
        private void OnChangeUserParty(UserParty party)
        {
            var userPartyIndex = UserParties.ToList().FindIndex(x => x.Id == party.Id);

            if (userPartyIndex >= 0)
            {
                UserParties[userPartyIndex].UpdateParty(party);;
                var parties = UserParties.ToArray();
                UserParties.Clear();
                UserParties.AddRange(parties.OrderByDescending(x => x.Party.Value.CreateTime));
            }

            var attackRouteIndex = AttackParties.ToList().FindIndex(x => x.Id == party.Id);

            if (attackRouteIndex >= 0)
            {
                AttackParties[attackRouteIndex].UpdateParty(party);
                CheckDoubling();
            }
        }