private void OnRemoveUserParty(UserParty party) { var userPartyIndex = UserParties.ToList().FindIndex(x => x.Id == party.Id); if (userPartyIndex >= 0) { UserParties.RemoveAt(userPartyIndex); } }
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(); } }