public AiTest() { BrandPlayer[] player = new BrandPlayer[4]; BrandPlayer table = new BrandPlayer(); BrandFactory x = new BrandFactory(); x.createBrands(); x.randomBrands(); table = x.getBrands(); Deal deal = new Deal(16,table); deal.DealBrands(); player = deal.Player; printplayer(player); //SimpleAI sa = new SimpleAI(); //sa.setPlayer(player[0]); //PlayerSort bs = new PlayerSort(player[0]); //player[0] = bs.getPlayer(); //PlayerSort bs = new PlayerSort(player[0]); PlayerSort bs = new PlayerSort(player[0],new FlowerBrand(0),new TenThousandBrand(0),new RopeBrand(0),new TubeBrand(0),new WordBrand(0)); player[0] = bs.getPlayer; Level_1 l = new Level_1(); l.setPlayer(player[0]); l.getReadyBrand(); //printplayer(player); //Level_1 l = new Level_1(); //BrandPlayer test = new BrandPlayer(); //test.add(new WordBrand(1)); //test.add(new WordBrand(1)); //test.add(new WordBrand(1)); //test.add(new WordBrand(2)); //test.add(new WordBrand(3)); //test.add(new WordBrand(3)); //test.add(new WordBrand(3)); //test.add(new WordBrand(5)); //l.setPlayer(test); l.setPlayer(player[0]); Brand t = l.getReadyBrand(); Console.WriteLine("==>{0}{1}", t.getNumber(), t.getClass()); //printplayer(player); //sa.getReadyBrand(); //Console.WriteLine(); //Console.WriteLine("Ready Brand is {0},{1}", l.getReadyBrand().getClass(), l.getReadyBrand().getNumber()); }
public DealTest() { BrandPlayer[] player = new BrandPlayer[4]; BrandPlayer table = new BrandPlayer(); BrandFactory x = new BrandFactory(); x.createBrands(); x.randomBrands(); table = x.getBrands(); Console.WriteLine("�@��: {0}",table.getCount()); // �L�X�~�n���P printplayer(table,"�üƵP"); PlayerSort bbs = new PlayerSort(table); BrandPlayer sort_table = bbs.getPlayer; printplayer(sort_table,"�üƱƧǦ^�h"); // ���t�P Deal deal = new Deal(16,table); deal.DealBrands(); player = deal.Player; // �L�X���������a printplayer(player); BrandPlayer check = new BrandPlayer(); foreach (BrandPlayer b in player) for (int i = 0; i < b.getCount(); i++) check.add(b.getBrand(i)); for (int i = 0; i < table.getCount(); i++) check.add(table.getBrand(i)); PlayerSort bs = new PlayerSort(check); check = bs.getPlayer; Console.WriteLine("\n�@��: {0}",check.getCount()); printplayer(check,"���s�ˬd"); }
/// <summary> /// ���t�P /// </summary> void dealbrands() { Deal deal = new Deal(all.Dealnumber, all.CountPlayer, all.Table); deal.DealBrands(); // get Players all.Players = deal.Player; // get Table all.Table = deal.Table; }