Exemple #1
0
        //obtains the premade game object, begin the game
        public frmGameWindow(Player[] players, int deckSize)
        {
            InitializeComponent();
            //create the deck
            game = new Durak(deckSize);
            //shuffling the deck, setting the players and AIs

            Players.InitializeGame(players, true);
            game.SetPlayers(players);

            //  Get reference to the game table (Card container)

            game.Table.InPlay.CardsChanged += hand_CardChanged;
            //lblTrump.Text = game.TrumpSuit();
            cbTrump.Card = game.TrumpCard;

            player = Players.GetHumanPlayer();
            player.PlayHand.CardsChanged += hand_CardChanged;
            //Dealing the hands
            game.DealHands();
            attacker = Players.GetCurrentPlayer();   //  Determine attacker
            defender = Players.PeakNextPlayer();     //  Determine defender

            lblDeckSize.Text = game.GetCardsRemaining().ToString();
        }