Пример #1
0
        protected override void UpdateMe(ViewerAccount newAccount)
        {
            if (!(newAccount is PlayerAccount))
            {
                throw new Exception($"Wrong account type: got {newAccount.GetType()} but PlayerAccount needed!");
            }

            base.UpdateMe(newAccount);
        }
Пример #2
0
        public void OnAllPersonsChanged()
        {
            AllPersons = new ViewerAccount[] { _showMan }
            .Concat(Players)
            .Concat(Viewers)
            .Where(a => a.IsConnected)
            .ToDictionary(a => a.Name);

            PersonsUpdateHistory.Append($"Update: ").Append(PrintPersons());
        }
Пример #3
0
        public void OnAllPersonsChanged()
        {
            try
            {
                AllPersons = new ViewerAccount[] { _showMan }
                .Concat(Players)
                .Concat(Viewers)
                .Where(a => a.IsConnected)
                .ToDictionary(a => a.Name);
            }
            catch (ArgumentException exc)
            {
                throw new Exception($"OnAllPersonsChanged error: {PersonsUpdateHistory}", exc);
            }

            PersonsUpdateHistory.Append($"Update: ").Append(PrintPersons());
        }
Пример #4
0
 protected static string PrintAccount(ViewerAccount viewerAccount) =>
 $"{viewerAccount?.Name}@{viewerAccount?.IsHuman}:{viewerAccount?.IsConnected}";