Example #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));
        }
Example #2
0
        protected override bool ExecuteAddParty(Party partyToAdd, bool isUser)
        {
            if (isUser)
            {
                UserParties.Add(partyToAdd);
            }
            else
            {
                BotParties.Add(partyToAdd);
            }

            return(true);
        }
Example #3
0
        public virtual bool AddParty(Party newParty, bool isUser = true)
        {
            if (newParty == null || (isUser ? UserParties.Contains(newParty) : BotParties.Contains(newParty)))
            {
                return(false);
            }

            if (isUser)
            {
                UserParties.Add(newParty);
            }
            else
            {
                if (newParty.ChannelAccount == null)
                {
                    throw new NullReferenceException($"Channel account of a bot party ({nameof(newParty.ChannelAccount)}) cannot be null");
                }

                BotParties.Add(newParty);
            }

            return(true);
        }
Example #4
0
 public void AddParty(UserParty party)
 {
     UserParties.Add(party);
     OnAddUserParty?.Invoke(party);
     FileManager.I.SaveJson(UserParties.ToArray());
 }