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); }
public void OnAllPersonsChanged() { AllPersons = new ViewerAccount[] { _showMan } .Concat(Players) .Concat(Viewers) .Where(a => a.IsConnected) .ToDictionary(a => a.Name); PersonsUpdateHistory.Append($"Update: ").Append(PrintPersons()); }
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()); }
protected static string PrintAccount(ViewerAccount viewerAccount) => $"{viewerAccount?.Name}@{viewerAccount?.IsHuman}:{viewerAccount?.IsConnected}";