Exemple #1
2
 public Player(String name, Random random, Game game)
 {
     this.name = name;
     this.random = random;
     this.game = game;
     this.cards = new Deck(new Card[] { });
     game.AddProgress(name + " has just joined the game");
 }
Exemple #2
0
 private void buttonStart_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(textName.Text))
     {
         MessageBox.Show("Please enter your name", "Can’t start the game yet");
         return;
     }
     game = new Game(textName.Text, new List<string> { "Joe", "Bob" }, textProgress);
     buttonStart.Enabled = false;
     textName.Enabled = false;
     buttonAsk.Enabled = true;
     UpdateForm();
 }
        private void startButton_Click_1(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(playerName.Text))
            {
                MessageBox.Show("Please enter your name", "Can't start the game yet");
            }
            else
            {
                game = new Game(playerName.Text, new List<string> { "Joe", "Bob" }, gameProgress);
                startButton.IsEnabled = false;
                playerName.IsEnabled = false;
                askForACard.IsEnabled = true;
                cards.IsEnabled = true;
                gameProgress.Content = "";
                gameBooks.Content = "";

                UpdateForm();
            }
        }
 public MainWindow()
 {
     InitializeComponent();
     game = FindResource("game") as Game;
 }