Exemplo n.º 1
0
 public FLGameRoom()
 {
     gamers   = new GamerInfo[3];
     landlord = new FightingLandlord();
     RoomId   = StartIndex;
     StartIndex++;
 }
Exemplo n.º 2
0
        bool OutCard(int [] cards, int seat)
        {
            if (seat != CurrentSeat)
            {
                return(false);
            }
            Array.Sort(cards);
            int a = cards[0];

            for (int i = 1; i < cards.Length; i++)
            {
                if (a == cards[i])
                {
                    return(false);
                }
                a = cards[i];
            }
            List <int> ca = Cards[CurrentSeat];

            for (int i = 0; i < cards.Length; i++)
            {
                if (!ca.Contains(cards[i]))
                {
                    return(false);
                }
            }
            var card = FightingLandlord.DeckAnalysis(cards);

            if (card == null)
            {
                return(false);
            }
            if (CurrentCard == null)
            {
                CurrentCard = card;
                CurrentSeat++;
                if (CurrentSeat >= 3)
                {
                    CurrentSeat = 0;
                }
                passCount = 0;
                return(true);
            }
            else
            {
                if (card.type == CardType.Bomb)
                {
                    if (card.num > CurrentCard.num)
                    {
                        CurrentCard = card;
                        CurrentSeat++;
                        if (CurrentSeat >= 3)
                        {
                            CurrentSeat = 0;
                        }
                        passCount = 0;
                        return(true);
                    }
                    return(false);
                }
                else
                {
                    if (card.type != CurrentCard.type)
                    {
                        return(false);
                    }
                    if (card.num > CurrentCard.num)
                    {
                        CurrentCard = card;
                        CurrentSeat++;
                        if (CurrentSeat >= 3)
                        {
                            CurrentSeat = 0;
                        }
                        passCount = 0;
                        return(true);
                    }
                    return(false);
                }
            }
        }