コード例 #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);
        }
コード例 #2
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");
 }