コード例 #1
0
        void nouth()
        {
            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() == 4 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 4 && y.getBrand(i + 2).getClass() == w.getClass() && y.getBrand(i + 2).getNumber() == 4)
                {
                    if (i < y.getCount() - 3 && y.getBrand(i + 3).getClass() == w.getClass() && y.getBrand(i + 3).getNumber() == 4)
                    {
                        i += 3;
                    }
                    temp += 1;
                    if (all.State == location.North)
                    {
                        textBox1.Text += "北風位\r\n";
                        tally         += 1;
                    }
                    if (l.Round == location.North)
                    {
                        textBox1.Text += "北風局\r\n";
                        tally         += 1;
                    }
                }
                else if (y.getBrand(i).getClass() == w.getClass() && y.getBrand(i).getNumber() == 4 && y.getBrand(i + 1).getClass() == w.getClass() && y.getBrand(i + 1).getNumber() == 4)
                {
                    index = true;
                }
            }
            //tally += 1;
        }
コード例 #2
0
        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 += "白板\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;
            //}
        }
コード例 #3
0
        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 += "青發\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;
            //}
        }
コード例 #4
0
        private void CPK_Load(object sender, EventArgs e)
        {
            Chow.Text     = Mahjong.Properties.Settings.Default.Chow;
            Pong.Text     = Mahjong.Properties.Settings.Default.Pong;
            Kong.Text     = Mahjong.Properties.Settings.Default.Kong;
            Win.Text      = Mahjong.Properties.Settings.Default.Win;
            Pass.Text     = Mahjong.Properties.Settings.Default.Pass;
            DarkKong.Text = Mahjong.Properties.Settings.Default.DarkKong;

            if (brand.getClass() == Mahjong.Properties.Settings.Default.Wordtiles)
            {
                WordBrand w = (WordBrand)brand;
                this.Text = pc.all.Name[pc.all.state] + " - " + w.getWordClass();
            }
            else
            {
                this.Text = pc.all.Name[pc.all.state] + " - " + brand.getNumber() + brand.getClass();
            }
        }
コード例 #5
0
ファイル: PlayerSort.cs プロジェクト: alring/mahjong
        /// <summary>
        /// 排序牌的建構子
        /// </summary>
        /// <param name="player">玩家</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();
        }
コード例 #6
0
ファイル: TallyTest.cs プロジェクト: alring/mahjong
        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();
        }