Ejemplo n.º 1
0
        public Form1(List <Player> inPlayers)
        {
            InitializeComponent();

            random   = new Random();
            cardPile = new CardsDeck();
            players  = new List <Player>(inPlayers);

            if (players.Count >= 2)
            {
                player1CardsTextBox.Visible = true;
                players[0].cardTextBox      = player1CardsTextBox;
                player2CardsTextBox.Visible = true;
                players[1].cardTextBox      = player2CardsTextBox;
            }
            if (players.Count >= 3)
            {
                player3CardsTextBox.Visible = true;
                players[2].cardTextBox      = player3CardsTextBox;
            }

            if (players.Count >= 4)
            {
                player4TextBox.Visible = true;
                players[3].cardTextBox = player3CardsTextBox;
            }

            newDeal();

            foreach (Player player in players)
            {
                player.cardTextBox.AppendText(player.getAllCardsInHand());
            }
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            random   = new Random();
            cardPile = new CardsDeck();
            Tom      = new Player("Tom", TomSurfaceCardTextBox, TomNumberOfCards);
            Bob      = new Player("Bob", bobSurfaceCardTextBox, BobNumberOfCards);
            Lily     = new Player("Lily", LilySurfaceCardTextBox, LilyNumberOfCards);

            players = new List <Player>()
            {
                Tom, Bob, Lily
            };
        }