Ejemplo n.º 1
0
        public void CheckChowResult(object sender, EventArgs e)
        {
            PlayerSort p = new PlayerSort((BrandPlayer)sender);

            all.chow_pong(sendoutbrand, p.getPlayer);
            chat.SendObject(all);
        }
Ejemplo n.º 2
0
        public void setPlayer(Brand brand, BrandPlayer player)
        {
            PlayerSort ps = new PlayerSort(
                player,
                new FlowerBrand(0),
                new TenThousandBrand(0),
                new TubeBrand(0),
                new RopeBrand(0),
                new WordBrand(0)
                );

            this.player      = ps.getPlayer;
            this.input_brand = brand;

            for (int j = 0; j < brands.Length; j++)
            {
                brands[j] = new BrandPlayer();
            }

            step0();
            step1();
            step2();
            step3();
            step4();
            step5();
            step6();
            step7();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 玩家按下吃事件呼叫
        /// </summary>
        internal void chow(Brand brand)
        {
            CheckBrands c = new CheckBrands(brand, NowPlayer_removeTeam);

            if (c.Chow())
            {
                if (c.ChowLength == 1)
                {
                    PlayerSort p = new PlayerSort(c.SuccessPlayer);
                    all.chow_pong(brand, p.getPlayer);
                }
                else
                {
                    if (all.State == table.place.Down)
                    {
                        ChowBrandCheck cbc = new ChowBrandCheck(c.ChowPlayer);
                        cbc.ShowDialog();
                        PlayerSort p = new PlayerSort(cbc.SelectBrandPlayer);
                        all.chow_pong(brand, p.getPlayer);
                    }
                    else
                    {
                        chat.SendObject(c.ChowPlayer);
                    }
                }
            }
            Chow_Pong_Brand = true;
            updatePlayer_Table();
        }
Ejemplo n.º 4
0
        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());
        }
Ejemplo n.º 5
0
 public AimbotOption()
 {
     IsEnable    = true;
     Fov         = 8.0;
     DrawFov     = true;
     MaxDistance = 1000;
     PlayerSort  = PlayerSort.Fov;
 }
Ejemplo n.º 6
0
 public void UpdatePlayerSort(int sorting)
 {
     if (Enum.IsDefined(typeof(PlayerSort), sorting))
     {
         playerSort = (PlayerSort)sorting;
         UpdatePlayerList();
     }
 }
Ejemplo n.º 7
0
 void Awake()
 {
     PS    = GetComponent <PlayerSort>();
     dir   = 0;
     ani   = GetComponent <Animator>();
     rgdy  = GetComponent <Rigidbody2D>();
     Wheel = GameObject.Find("Wheel");
     Light = GameObject.Find("Light");
 }
Ejemplo n.º 8
0
        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());
            // 印出洗好的牌
            printplayer(table, "亂數牌");

            PlayerSort  bbs        = new PlayerSort(table);
            BrandPlayer sort_table = bbs.getPlayer;

            printplayer(sort_table, "亂數排序回去");

            // 分配牌
            Deal deal = new Deal(16, table);

            deal.DealBrands();
            player = deal.Player;

            // 印出全部的玩家
            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, "重新檢查");
        }
Ejemplo n.º 9
0
 // Update is called once per frame
 void Start()
 {
     num = 0;
     PS  = GetComponent <PlayerSort>();
 }
Ejemplo n.º 10
0
 void Start()
 {
     Player = GameObject.Find("Player");
     rgdy   = Player.GetComponent <Rigidbody2D>();
     PS     = Player.GetComponent <PlayerSort>();
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 現在的玩家排序
        /// </summary>
        public void sortNowPlayer()
        {
            PlayerSort ps = new PlayerSort(players[state]);

            players[state] = ps.getPlayer;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 胡牌 成立
        /// </summary>
        /// <returns>是/否</returns>
        public bool Win()
        {
            if (brand != null)
            {
                x.add(brand);
                PlayerSort d = new PlayerSort(x);
                x = d.getPlayer;
            }
            brand_2();
            bradn_4();
            bradn_3();

            // 組合測試
            // a 三支
            // b 兩隻
            // c 組合
            int count = 0;

            for (int i = 0; i < a.getCount(); i += 3)
            {
                for (int j = i + 3; j < a.getCount(); j += 3)
                {
                    for (int k = j + 3; k < a.getCount(); k += 3)
                    {
                        for (int l = k + 3; l < a.getCount(); l += 3)
                        {
                            for (int m = l + 3; m < a.getCount(); m += 3)
                            {
                                for (int n = 0; n < b.getCount(); n += 2)
                                {
                                    c.clear();
                                    c.add(a.getBrand(i));
                                    c.add(a.getBrand(i + 1));
                                    c.add(a.getBrand(i + 2));
                                    c.add(a.getBrand(j));
                                    c.add(a.getBrand(j + 1));
                                    c.add(a.getBrand(j + 2));
                                    c.add(a.getBrand(k));
                                    c.add(a.getBrand(k + 1));
                                    c.add(a.getBrand(k + 2));
                                    c.add(a.getBrand(l));
                                    c.add(a.getBrand(l + 1));
                                    c.add(a.getBrand(l + 2));
                                    c.add(a.getBrand(m));
                                    c.add(a.getBrand(m + 1));
                                    c.add(a.getBrand(m + 2));
                                    c.add(b.getBrand(n));
                                    c.add(b.getBrand(n + 1));

                                    PlayerSort d = new PlayerSort(c);
                                    c = d.getPlayer;
                                    //牌的比對
                                    //完全成立代表胡牌
                                    for (int o = 0; o < x.getCount(); o++)
                                    {
                                        if (c.getBrand(o).getClass() == x.getBrand(o).getClass() &&
                                            c.getBrand(o).getNumber() == x.getBrand(o).getNumber())
                                        {
                                            count = o;
                                            continue;
                                        }
                                        else
                                        {
                                            break;
                                        }
                                    }
                                    if (count == x.getCount() - 1)
                                    {
                                        if (brand != null)
                                        {
                                            x.remove(brand);
                                        }
                                        return(true); // 成立
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (brand != null)
            {
                x.remove(brand);
            }
            return(false);
        }