Ejemplo n.º 1
0
        //public void TryCloseAnyGamerCard()
        //{
        //    var i = DeskCards.Count;
        //    foreach (var cardDesk in DeskCards)
        //    {
        //        foreach (var card in BotHand)
        //        {
        //            if (IsClosingRight(card, cardDesk.Back))
        //            {
        //                cardDesk.Close(card);
        //                BotHand.Remove(card);
        //                i--;
        //                break;
        //            }
        //        }
        //    }

        //    if (i != 0)
        //    {
        //        foreach (var card in DeskCards)
        //        {
        //            BotHand.Add(card.Back);
        //            if (card.Fore != null)
        //                BotHand.Add(card.Fore);
        //        }
        //        Thread.Sleep(1000);
        //        DeskCards.Clear();
        //        AddCardsToGamersHands();
        //    }

        //    if (i == 0)
        //    {
        //        DeskCards.Clear();
        //        AddCardsToGamersHands();
        //        WhosTurn = Players.Bot;
        //    }
        //}

        public void CloseTurn()
        {
            if (DeskCards[0].ContainsFore)
            {
                if (WhosTurn == Players.Gamer)
                {
                    DeskCards.Clear();
                    AddCardsToGamersHands();
                    WhosTurn = Players.Bot;
                }
                else
                {
                    DeskCards.Clear();
                    AddCardsToGamersHands();
                    WhosTurn = Players.Gamer;
                }
            }
            else if (DeskCards[0].ContainsFore == false)
            {
                if (WhosTurn == Players.Gamer)
                {
                    BotHand.Add(DeskCards[0].Back);
                    DeskCards.Clear();
                    AddCardsToGamersHands();
                }
                else
                {
                    GamerHand.Add(DeskCards[0].Back);
                    DeskCards.Clear();
                    AddCardsToGamersHands();
                }
            }
        }