예제 #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
파일: GameData.cs 프로젝트: VladimirKhil/SI
        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
파일: Data.cs 프로젝트: VladimirKhil/SI
 protected static string PrintAccount(ViewerAccount viewerAccount) =>
 $"{viewerAccount?.Name}@{viewerAccount?.IsHuman}:{viewerAccount?.IsConnected}";