예제 #1
0
        private void GameClientOnLobbyPlayersUpdated(LobbyPlayersUpdate lobbyPlayersUpdate)
        {
            var lobbyPlayers = new List <LobbyPlayer>();

            foreach (var lobbyPlayer in lobbyPlayersUpdate.LobbyPlayers)
            {
                lobbyPlayers.Add(new LobbyPlayer(lobbyPlayer.PlayerId, lobbyPlayer.PlayerName,
                                                 Color.FromArgb(lobbyPlayer.Color), (PlayerPosition)lobbyPlayer.PlayerPosition));
            }

            _lobbyPlayers = lobbyPlayers;
            LobbyPlayersUpdated?.Invoke(lobbyPlayers);
        }
예제 #2
0
        private void LobbyPlayersUpdate()
        {
            var allLobbyPlayers = GetAllLobbyPlayers();

            var lobbyPlayersUpdate = new LobbyPlayersUpdate(new List <VsadilNestihl.Networking.Messages.Lobby.LobbyPlayer>());

            foreach (var lobbyPlayer in allLobbyPlayers)
            {
                lobbyPlayersUpdate.LobbyPlayers.Add(new VsadilNestihl.Networking.Messages.Lobby.LobbyPlayer(
                                                        lobbyPlayer.PlayerId, lobbyPlayer.PlayerName, lobbyPlayer.Color.ToArgb(), (int)lobbyPlayer.PlayerPosition));
            }

            LobbyPlayersUpdated?.Invoke(allLobbyPlayers);

            foreach (var lobbyPlayer in allLobbyPlayers.Where(x => x.PlayerHandler != null))
            {
                lobbyPlayer.PlayerHandler.LobbyPlayersUpdate(lobbyPlayersUpdate);
            }
        }
예제 #3
0
 private void OnLobbyPlayersUpdate(LobbyPlayersUpdate lobbyPlayersUpdate)
 {
     LobbyPlayersUpdated?.Invoke(lobbyPlayersUpdate);
 }