Esempio n. 1
0
        public void Power()
        {
            ReadyPower power = new ReadyPower(handTable.TableMap(hod.count).Concat(handTable.PlayerMap(hod.count)).ToArray());

            SeniorMap.Text      = power.CombName() + " " + string.Join(" ", convert.ConvertTextArray(power.CombSenior()));
            SeniorMap.ForeColor = Color.Red;
        }
Esempio n. 2
0
        //Ход игры
        public void GameRes(ref int gamerOne, ref int gamerTwo, ref int powerGamerOne, ref int powerGamerTwo)
        {
            while (true)
            {
                Thread.Sleep(200);
                //Чтобы первоначальная ставка прошла без лагов

                FirstPartEnd();

                if (GameWho == 0 && gamerOne != 0)
                {
                    if (gamerOne == 1)
                    {
                        powerGamerOne = 0;
                        count         = 4;
                        gamerOne      = 0; gamerTwo = 0;
                        allRate      += RateBot + RateGamer;
                        break;
                    }
                }
                if (GameWho == 1 && gamerTwo != 0)
                {
                    if (gamerTwo == 1)
                    {
                        powerGamerTwo = 0;
                        count         = 4;
                        gamerOne      = 0; gamerTwo = 0;
                        allRate      += RateBot + RateGamer;
                        break;
                    }
                }
                if (gamerOne != 0 && gamerTwo != 0)
                {
                    //Проверяем продожитсья ли игра после решения.
                    bool checking = GameHod(ref gamerOne, ref gamerTwo);

                    //Если условия верны для продолжение игры
                    if (checking == true)
                    {
                        //Складываем все ставки и добавляем в общие
                        //преходим на следующий шаг
                        if (Who == 1)
                        {
                            Who = 0;
                        }
                        else
                        {
                            Who = 1;
                        }
                        gamerOne = 0; gamerTwo = 0;
                        count++;
                        GameWho   = Who;
                        allRate  += RateBot + RateGamer;
                        RateGamer = 0;
                        RateBot   = 0;

                        break;
                    }
                    else
                    {
                        gamerOne = 0;
                        if (Who == (int)WhoGoes.bot)
                        {
                            Who = (int)WhoGoes.gamer;
                        }
                        else
                        {
                            Who = (int)WhoGoes.bot;
                        }
                        //Если условия не удволетворяют для продолжение игры то, мы меняем
                        GameStart();
                    }
                }
                powerBot   = new ReadyPower(mapBot.Concat(mapTable).ToArray()).CombPower();
                powerGamer = new ReadyPower(mapGamer.Concat(mapTable).ToArray()).CombPower();
            }
        }