示例#1
0
        public CardPack CreateOpenedClosedPack()
        {
            CustomCardPack pack = new CustomCardPack();

            pack.displayMode = CardPack.DisplayMode.OnlyLast;

            pack.canAccept = (cp) =>
            {
                return(true);
            };

            pack.canGive = (count) =>
            {
                return(count == 1 && count <= pack.Count);
            };

            pack.OnActivate = () =>
            {
                if (cardPackTable["closed"].Count == 0)
                {
                    int c = pack.Count - 1;
                    for (int i = 0; i < c; i++)
                    {
                        ConfirmMove(cardPackTable["openedClosed"], cardPackTable["closed"], 1);
                    }
                }
            };

            return(pack);
        }
示例#2
0
        public CardPack CreateClosedPack()
        {
            CustomCardPack pack        = new CustomCardPack();
            Boolean        canGiveFlag = false;

            pack.displayMode = CardPack.DisplayMode.Hidden;

            pack.canAccept = (cp) =>
            {
                return(true);
            };

            pack.canGive = (count) =>
            {
                return(canGiveFlag);
            };

            pack.OnActivate = () =>
            {
                if (cardPackTable["closed"].Count == 0)
                {
                    return;
                }
                canGiveFlag = true;
                ConfirmMove(cardPackTable["closed"], cardPackTable["openedClosed"], 1);
                canGiveFlag = false;
            };

            return(pack);
        }
示例#3
0
        public CardPack CreateGamePack()
        {
            CustomCardPack pack = new CustomCardPack();

            pack.displayMode = CardPack.DisplayMode.Full;

            // TODO: написать реализацию
            pack.canAccept = (cp) =>
            {
                if (pack.Count == 0)
                {
                    return(true);
                }
                if (Card.CardColor(cp.FirstCard) == Card.CardColor(pack.LastCard) ||
                    Card.Dignity(cp.FirstCard) >= Card.Dignity(pack.LastCard))
                {
                    return(false);
                }
                return(true);
            };

            pack.canGive = (count) =>
            {
                return(count <= pack.Count);
            };

            return(pack);
        }
示例#4
0
        public override CardPack Copy()
        {
            var pack = new CustomCardPack(this.cards, this.displayMode);

            pack.canAccept = this.canAccept;
            pack.canGive   = this.canGive;
            return(pack);
        }
示例#5
0
        public CardPack CreateSecretPack()
        {
            CustomCardPack pack = new CustomCardPack();

            pack.displayMode = CardPack.DisplayMode.OnlyLast;

            pack.canAccept = (cp) =>
            {
                return(true);
            };

            // TODO: написать реализацию
            pack.canGive = (count) =>
            {
                return(count == 1 && count <= pack.Count);
            };

            return(pack);
        }
示例#6
0
        public CardPack CreateBasePack()
        {
            CustomCardPack pack = new CustomCardPack();

            pack.displayMode = CardPack.DisplayMode.OnlyLast;

            pack.canAccept = (cp) =>
            {
                if (pack.Count == 0)
                {
                    return(cp.Count == 1 && Card.Dignity(cp.FirstCard) == 0);
                }
                return(cp.Count == 1 &&
                       Card.Suit(cp.FirstCard) == Card.Suit(pack.LastCard) &&
                       Card.Dignity(cp.FirstCard) - Card.Dignity(pack.LastCard) == 1);
            };

            pack.canGive = (count) =>
            {
                return(false);
            };

            return(pack);
        }