ArmedCards.BusinessLogic.AppServices.Hubs.SendMessage.CommanderLeft C# (CSharp) Метод

CommanderLeft() публичный Метод

Alert the users that the round has been lost because the commander has left
public CommanderLeft ( Entities game, String commanderName ) : void
game Entities The game
commanderName String The commander's name
Результат void
        public void CommanderLeft(Entities.Game game, String commanderName)
        {
            Entities.Filters.ActiveConnection.SelectAll filter = new Entities.Filters.ActiveConnection.SelectAll();
            filter.GroupName = String.Format("Game_{0}", game.GameID);

            List<Entities.ActiveConnection> connections = _selectActiveConnection.Execute(filter);

            Entities.GamePlayer sendToPlayer = null;

            foreach (Entities.ActiveConnection connection in connections)
            {
                sendToPlayer = game.Players.FirstOrDefault(player => player.User.UserId == connection.User_UserId);

                if (sendToPlayer != null)
                {
                    Entities.Models.Game.Board.GameBoard model = GetGameBoardModal(connection, game);

                    _hub.Clients.Client(connection.ActiveConnectionID)
                                       .CommanderLeft(model, GetGameLobbyViewModel(connection, game), commanderName, game.IsWaiting());
                }
            }
        }