Exemple #1
0
        public LobbyPlayer(LobbyPlayerData data, bool withoutReadyIndicator = false)
        {
            InitializeComponent();
            if (withoutReadyIndicator)
            {
                readyState.Visibility = Visibility.Hidden;
            }
            else if (data.Leader)
            {
                readyState.Fill = new SolidColorBrush(Color.FromRgb(0x10, 0x00, 0xef));
            }
            else if (data.Ready)
            {
                readyState.Fill = new SolidColorBrush(Color.FromRgb(0x00, 0xC0, 0x00));
            }
            else
            {
                readyState.Fill = new SolidColorBrush(Color.FromRgb(0xC0, 0x00, 0x00));
            }

            PlayerId            = data.Id;
            lblName.Content     = data.Name;
            lblScore.Content    = data.Score.ToString(Strings.Culture);
            lblWins.Content     = "Won/Played: " + data.Won + "/" + data.Played;
            ColorBox.Background = new SolidColorBrush(data.Color);
            currentPlayer       = data.CurrentPlayer;
            btnKick.Visibility  = Visibility.Collapsed;
        }
Exemple #2
0
 private void AddPlayer(LobbyPlayerData data)
 {
     if (spPlayers.Children.Count < SharedDef.MAX_TOURNAMENT_PLAYERS)
     {
         LobbyPlayer p = new LobbyPlayer(data);
         if (leader)
         {
             p.EnableKickButton();
         }
         spPlayers.Children.Add(p);
     }
 }