예제 #1
0
 public LocalTurn(Player aPlayer, Dealer deal, Deck deckarg, frmGameBoard game, DatabaseAccess data)
 {
     player    = aPlayer;
     dealer    = deal;
     deck      = deckarg;
     gameBoard = game;
     database  = data;
 }
예제 #2
0
        private async void playButton_Click(object sender, EventArgs e)
        {
            await database.createLocalGame(localGame.PlayerList[0].Username, localGame);

            await database.returnPlayer(localGame.PlayerList[0].Username);

            await database.doesLocalPlayerExist(localGame.PlayerList[0].Username, 0);

            if (database.LocalPlayerExists)
            {
                playerList.Add(database.CurrentPlayer);
            }
            frmGameBoard gameBoardInstance = new frmGameBoard(playerList, database, localGame)
            {
                Location = this.Location
            };

            this.Hide();
            // This is an event handler for the closing of a child form
            // Passes the subject (child form) and arguments to close
            // Parent form as well
            gameBoardInstance.Show();
            gameBoardInstance.FormClosed += (s, args) => this.Close();
        }