Exemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            
            Human humanPlayer = new Human("You");
            Android housePlayer = new Android("House");
            Deck d = new Deck();
            Hand h = new Hand();
            Dealer dlr = new Dealer(humanPlayer, housePlayer);
            
            InputViewForm i = new InputViewForm(dlr.handle,dlr.handleTwo,dlr.handleThree,humanPlayer);  // recall that  c.handle  has type InputHandler
            OutputViewForm o = new OutputViewForm(humanPlayer);
            HouseForm houseForm = new HouseForm(housePlayer);

            o.Show();
            houseForm.Show();
            i.Show();
            
            dlr.register(i.showCards);  // C# requires that you tell an output form to show itself
            dlr.register(o.showScore);
            dlr.register(houseForm.showInfo);
            dlr.playRound();
            Application.Run(i);
        }
Exemplo n.º 2
0
 static void testHuman()
 {
     BlackJack3.Deck d = new BlackJack3.Deck();
     Human hm = new Human("Human");
     Console.WriteLine("Testing Human.cs.....\n");
     hm.getsCard(d.deal());
     Console.WriteLine("Human's card is: " + hm.showHand().ToString());
 }
Exemplo n.º 3
0
 static void testDealer()
 {
     Human gP = new Human("Human");
     Android hP = new Android("House");
     Dealer dl = new Dealer(gP, hP);
     dl.playRound();
     Console.WriteLine("Testing Dealer.cs.....\n");
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor for Inputview form.
 /// </summary>
 /// <param name="add"></param>
 /// <param name="hold"></param>
 /// <param name="restart"></param>
 /// <param name="h"></param>
 public InputViewForm(InputHandler add, InputHandlerTwo hold, InputHandlerThree restart, Human h)
 {
     InitializeComponent();
     x = add;
     y = hold;
     z = restart;
     this.h = h;
     button2.Enabled = false;
 }
Exemplo n.º 5
0
 int win = 0;                                              // Numbers of wins for Human Player.
 
 /// <summary>
 /// Constructor for a Dealer Class(Controller)
 /// </summary>
 /// <param name="h"></param>
 /// <param name="a"></param>
 public Dealer(Human h, Android a)
 {
     this.guestPlayer = h; this.housePlayer = a;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor for ScoreCard form.
 /// </summary>
 /// <param name="h"></param>
 public OutputViewForm(Human h)
 {
     this.h = h;
     InitializeComponent();
 }
Exemplo n.º 7
0
        int win   = 0;                                             // Numbers of wins for Human Player.

        /// <summary>
        /// Constructor for a Dealer Class(Controller)
        /// </summary>
        /// <param name="h"></param>
        /// <param name="a"></param>
        public Dealer(Human h, Android a)
        {
            this.guestPlayer = h; this.housePlayer = a;
        }