private void AddNopeTrackBtns() { Image img = PlayOverlay_NoNopes; NopeTrack.Children.Clear(); Player p = game.ActivePlayer; for (int i = 0; i < game.Players.Count; i++) { if (!p.IsActive) { PlayerNope nope = new PlayerNope(); nope.PlayerName = p.Name; nope.Id = p.Id; nope.MouseDown += PlayOverlay_Nope_MouseDown; nope.Margin = new Thickness(0, 0, 0, 20); NopeTrack.Children.Add(nope); } p = game.GetNextPlayer(p); } NopeTrack.Children.Add(img); }
private void PlayOverlay_Nope_MouseDown(object sender, MouseButtonEventArgs e) { //AddNopeTrackBtns(); PlayerNope playerNope = sender as PlayerNope; Player p = game.GetSelectedPlayer(playerNope.Id); Card c = p.Hand.GetNope(); if (c.GetType() == typeof(NullCard)) { MessageBox.Show($"Sorry, {p.Name}, but you don't have any Nope cards.");//todo MessageBox } else { p.PlayCard(c); MessageBox.Show($"{p.Name} noped your card, {game.ActivePlayer.Name}");//todo MessageBox NopeTrack.Visibility = Visibility.Hidden; PlayOverlay.Visibility = Visibility.Hidden; PlayOverlay_Back.Visibility = Visibility.Visible; PlayOverlay_Play.Visibility = Visibility.Visible; PlayOverlay_Steal_Random.Visibility = Visibility.Visible; PlayOverlay_Steal_Specific.Visibility = Visibility.Visible; ShowHand(); } }