public Brand copyBrand(Brand brand) { Brand newBrand = new WordBrand(brand.getNumber()); newBrand.WhoPush = brand.WhoPush; newBrand.IsCanSee = brand.IsCanSee; return(newBrand); }
/// <summary> /// �ƧǵP���غc�l /// </summary> /// <param name="player">���a</param> public PlayerSort(BrandPlayer player) { this.inputPlayer = player; for (int i = 0; i < tempPlayers.Length; i++) tempPlayers[i] = new BrandPlayer(); teamBrands = new BrandPlayer(); BrandClass[0] = new FlowerBrand(0); BrandClass[1] = new TenThousandBrand(0); BrandClass[2] = new RopeBrand(0); BrandClass[3] = new TubeBrand(0); BrandClass[4] = new WordBrand(0); getBrands( inputPlayer.creatIterator() ); sortPlayer(); sortTeam(); compose(); }
void white() { WordBrand w = new WordBrand(0); for (int i = 0; i < y.getCount() - 2; i++) if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 5 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 5 && y.getBrand(i + 2).getClass() == w.getClass() && y.getBrand(i + 2).getNumber() == 5) //if (brands[i].getClass() == w.getClass() && brands[i].getNumber() == 5 && brands[i + 1].getClass() == w.getClass() && brands[i + 1].getNumber() == 5 && brands[i + 2].getClass() == w.getClass() && brands[i + 2].getNumber() == 5) { if (i < y.getCount() - 3 && y.getBrand(i + 3).getClass() == w.getClass() && y.getBrand(i + 3).getNumber() == 5) i+=3; //i += 2; tally += 1; temp += 1; textBox1.Text += "�ժO\r\n"; } else if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 5 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 5) { index = true; } //if (temp == 1) // tally += 1; //else if (brands[i+1].getClass() == w.getClass() && brands[i+1].getNumber() == 5 && brands[i + 2].getClass() == w.getClass() && brands[i + 2].getNumber() == 5) //{ // temp += 2; //} }
void west() { WordBrand w = new WordBrand(0); for (int i = 0; i < y.getCount() - 2; i++) if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 3 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 3 && y.getBrand(i + 2).getClass() == w.getClass() && y.getBrand(i + 2).getNumber() == 3) { if (i < y.getCount() - 3 && y.getBrand(i + 3).getClass() == w.getClass() && y.getBrand(i + 3).getNumber() == 3) i+=3; temp += 1; if (all.State == location.West) { textBox1.Text += "�護��\r\n"; tally += 1; } if (l.Round == location.West) { textBox1.Text += "�護��\r\n"; tally += 1; } } else if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 3 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 3) { index = true; } //tally += 1; }
void green() { WordBrand w = new WordBrand(0); for (int i = 0; i < y.getCount() - 2; i++) //if (brands[i].getClass() == w.getClass() && brands[i].getNumber() == 6 && brands[i + 1].getClass() == w.getClass() && brands[i + 1].getNumber() == 6 && brands[i + 2].getClass() == w.getClass() && brands[i + 2].getNumber() == 6) if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 6 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 6 && y.getBrand(i + 2).getClass() == w.getClass() && y.getBrand(i + 2).getNumber() == 6) { if (i < y.getCount()-3 && y.getBrand(i + 3).getClass() == w.getClass() && y.getBrand(i + 3).getNumber() == 6) i+=3; //i += 2; tally += 1; temp += 1; textBox1.Text += "�C�o\r\n"; } else if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 6 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 6) { index = true; } //textBox1.Text += temp.ToString(); // if (temp == 2) // tally += 1; //else if (brands[i+1].getClass() == w.getClass() && brands[i+1].getNumber() == 6 && brands[i + 2].getClass() == w.getClass() && brands[i + 2].getNumber() == 6) //{ // temp += 2; //} }
public Brand copyBrand(Brand brand) { Brand newBrand = new WordBrand(brand.getNumber()); newBrand.WhoPush = brand.WhoPush; newBrand.IsCanSee = brand.IsCanSee; return newBrand; }
public TallyTest() { BrandPlayer a = new BrandPlayer(); a.add(new TubeBrand(1)); a.add(new TubeBrand(1)); a.add(new TubeBrand(1)); a.add(new TubeBrand(1)); a.add(new RopeBrand(1)); a.add(new RopeBrand(1)); a.add(new RopeBrand(1)); a.add(new RopeBrand(1)); a.add(new TenThousandBrand(1)); a.add(new TenThousandBrand(1)); a.add(new TenThousandBrand(1)); a.add(new TenThousandBrand(1)); a.add(new TubeBrand(9)); a.add(new TubeBrand(9)); a.add(new TubeBrand(9)); a.add(new TubeBrand(9)); a.add(new RopeBrand(9)); a.add(new RopeBrand(9)); a.add(new RopeBrand(9)); a.add(new RopeBrand(9)); //a.add(new WordBrand(4)); a.add(new WordBrand(4)); a.add(new WordBrand(4)); ////a.add(new WordBrand(1)); //a.add(new WordBrand(1)); //a.add(new WordBrand(1)); //a.add(new WordBrand(1)); ////a.add(new WordBrand(2)); //a.add(new WordBrand(2)); //a.add(new WordBrand(2)); //a.add(new WordBrand(2)); ////a.add(new WordBrand(3)); //a.add(new WordBrand(3)); //a.add(new WordBrand(3)); //a.add(new WordBrand(3)); f = new Tally(); Location l = new Location(); AllPlayers all = new AllPlayers(4, 16); WordBrand w = new WordBrand(9); WordBrand v = new WordBrand(9); w.WhoPush = location.East; //v.WhoPush = location.Table; all.Show_Table.add(w); //all.NowPlayer.add(v); f.setPlayer(all); f.setPlayer(a); //l.next_Winer(); f.setLocation(l,0); f.ShowDialog(); }