Exemplo n.º 1
0
        protected Card(
            string name,
            Expansion expansion,
            int coinCost,
            string pluralName = null,
            int potionCost    = 0,
            int plusActions   = 0,
            int plusBuy       = 0,
            int plusCards     = 0,
            int plusCoins     = 0,
            VictoryPointCounter victoryPoints = null,
            int plusVictoryToken             = 0,
            int defaultSupplyCount           = 10,
            bool isAction                    = false,
            bool isAttack                    = false,
            bool attackDependsOnPlayerChoice = false,
            bool isAttackBeforeAction        = false,
            bool isCurse              = false,
            bool isReaction           = false,
            bool isPrize              = false,
            bool isRuins              = false,
            bool isTreasure           = false,
            bool isDuration           = false,
            bool requiresRuins        = false,
            bool requiresSpoils       = false,
            bool isShelter            = false,
            bool isTraveller          = false,
            bool isReserve            = false,
            bool canOverpay           = false,
            bool mightMultiplyActions = false,
            CardIntValue provideDiscountForWhileInPlay                    = null,
            GameStateMethod doSpecializedCleanupAtStartOfCleanup          = null,
            GameStateCardMethod doSpecializedActionOnBuyWhileInPlay       = null,
            GameStateCardPredicate doSpecializedActionOnTrashWhileInHand  = null,
            GameStateCardToPlacement doSpecializedActionOnGainWhileInPlay = null,
            GameStateCardToPlacement doSpecializedActionOnBuyWhileInHand  = null,
            GameStateCardToPlacement doSpecializedActionOnGainWhileInHand = null)
        {
            lock (Card.cardTypes)
            {
                if (Card.cardTypes.Contains(this.GetType()))
                {
                    throw new Exception("Do not create duplicate cards.");
                }
                else
                {
                    Card.cardTypes.Add(this.GetType());
                }

                this.privateIndex = Card.lastCardIndex++;
            }

            this.name                                  = name;
            this.pluralName                            = pluralName != null ? pluralName : name + "s";
            this.expansion                             = expansion;
            this.coinCost                              = coinCost;
            this.potionCost                            = potionCost;
            this.plusAction                            = plusActions;
            this.plusBuy                               = plusBuy;
            this.plusCard                              = plusCards;
            this.plusCoin                              = plusCoins;
            this.victoryPointCounter                   = victoryPoints;
            this.plusVictoryToken                      = plusVictoryToken;
            this.isAction                              = isAction;
            this.isAttack                              = isAttack;
            this.attackDependsOnPlayerChoice           = attackDependsOnPlayerChoice;
            this.isAttackBeforeAction                  = isAttackBeforeAction;
            this.isCurse                               = isCurse;
            this.isReaction                            = isReaction;
            this.isPrize                               = isPrize;
            this.isRuins                               = isRuins;
            this.isTreasure                            = isTreasure;
            this.defaultSupplyCount                    = defaultSupplyCount;
            this.requiresRuins                         = requiresRuins;
            this.isDuration                            = isDuration;
            this.isShelter                             = isShelter;
            this.isTraveller                           = isTraveller;
            this.isReserve                             = isReserve;
            this.requiresSpoils                        = requiresSpoils;
            this.canOverpay                            = canOverpay;
            this.mightMultiplyActions                  = mightMultiplyActions;
            this.provideDiscountForWhileInPlay         = provideDiscountForWhileInPlay;
            this.doSpecializedCleanupAtStartOfCleanup  = doSpecializedCleanupAtStartOfCleanup;
            this.doSpecializedActionOnBuyWhileInPlay   = doSpecializedActionOnBuyWhileInPlay;
            this.doSpecializedActionOnTrashWhileInHand = doSpecializedActionOnTrashWhileInHand;
            this.doSpecializedActionOnGainWhileInPlay  = doSpecializedActionOnGainWhileInPlay;
            this.doSpecializedActionOnBuyWhileInHand   = doSpecializedActionOnBuyWhileInHand;
            this.doSpecializedActionOnGainWhileInHand  = doSpecializedActionOnGainWhileInHand;
        }
Exemplo n.º 2
0
 protected Card(
     string name,
     Expansion expansion,
     int coinCost      = 0,
     int potionCost    = 0,
     int debtCost      = 0,
     Edition edition   = Edition.First,
     bool isDeprecated = false,
     string pluralName = null,
     StartingLocation startingLocation = Dominion.StartingLocation.Supply,
     int plusActions = 0,
     int plusBuy     = 0,
     int plusCards   = 0,
     int plusCoins   = 0,
     VictoryPointCounter victoryPoints = null,
     int plusVictoryToken             = 0,
     int defaultSupplyCount           = 10,
     bool isAction                    = false,
     bool isAttack                    = false,
     bool attackDependsOnPlayerChoice = false,
     bool isAttackBeforeAction        = false,
     bool isCurse              = false,
     bool isReaction           = false,
     bool isNight              = false,
     bool isPrize              = false,
     bool isRuins              = false,
     bool isTreasure           = false,
     bool isDuration           = false,
     bool isLooter             = false,
     bool requiresSpoils       = false,
     bool isShelter            = false,
     bool isTraveller          = false,
     bool isReserve            = false,
     bool isGathering          = false,
     bool isHeirloom           = false,
     bool isFate               = false,
     bool isDoom               = false,
     bool isZombie             = false,
     bool isSpirit             = false,
     bool isCastle             = false,
     bool canOverpay           = false,
     bool canGivePlusAction    = false,
     bool mightMultiplyActions = false,
     bool isKingdomCard        = true,
     CardIntValue provideDiscountForWhileInPlay                    = null,
     GameStateMethod doSpecializedCleanupAtStartOfCleanup          = null,
     GameStateCardMethod doSpecializedActionOnBuyWhileInPlay       = null,
     GameStateCardPredicate doSpecializedActionOnTrashWhileInHand  = null,
     GameStateCardToPlacement doSpecializedActionOnGainWhileInPlay = null,
     GameStateCardToPlacement doSpecializedActionOnBuyWhileInHand  = null,
     GameStateCardToPlacement doSpecializedActionOnGainWhileInHand = null,
     GameStateCardMethod doSpecializedActionToCardWhileInPlay      = null)
     : base(name, expansion, edition, isDeprecated, pluralName)
 {
     this.coinCost                    = coinCost;
     this.potionCost                  = potionCost;
     this.debtCost                    = debtCost;
     this.plusAction                  = plusActions;
     this.plusBuy                     = plusBuy;
     this.plusCard                    = plusCards;
     this.plusCoin                    = plusCoins;
     this.victoryPointCounter         = victoryPoints;
     this.plusVictoryToken            = plusVictoryToken;
     this.isAction                    = isAction;
     this.isAttack                    = isAttack;
     this.attackDependsOnPlayerChoice = attackDependsOnPlayerChoice;
     this.isAttackBeforeAction        = isAttackBeforeAction;
     this.isCurse                     = isCurse;
     this.isReaction                  = isReaction;
     this.isNight                     = isNight;
     this.isPrize                     = isPrize;
     this.isRuins                     = isRuins;
     this.isTreasure                  = isTreasure;
     this.isFate                                = isFate;
     this.isDoom                                = isDoom;
     this.isHeirloom                            = isHeirloom;
     this.isSpirit                              = isSpirit;
     this.isZombie                              = isZombie;
     this.isCastle                              = isCastle;
     this.isLooter                              = isLooter;
     this.defaultSupplyCount                    = defaultSupplyCount;
     this.isLooter                              = isLooter;
     this.isDuration                            = isDuration;
     this.isShelter                             = isShelter;
     this.isTraveller                           = isTraveller;
     this.isReserve                             = isReserve;
     this.isGathering                           = isGathering;
     this.isKingdomCard                         = isKingdomCard;
     this.requiresSpoils                        = requiresSpoils;
     this.canOverpay                            = canOverpay;
     this.canGivePlusAction                     = canGivePlusAction;
     this.mightMultiplyActions                  = mightMultiplyActions;
     this.provideDiscountForWhileInPlay         = provideDiscountForWhileInPlay;
     this.doSpecializedCleanupAtStartOfCleanup  = doSpecializedCleanupAtStartOfCleanup;
     this.doSpecializedActionOnBuyWhileInPlay   = doSpecializedActionOnBuyWhileInPlay;
     this.doSpecializedActionOnTrashWhileInHand = doSpecializedActionOnTrashWhileInHand;
     this.doSpecializedActionOnGainWhileInPlay  = doSpecializedActionOnGainWhileInPlay;
     this.doSpecializedActionOnBuyWhileInHand   = doSpecializedActionOnBuyWhileInHand;
     this.doSpecializedActionOnGainWhileInHand  = doSpecializedActionOnGainWhileInHand;
     this.doSpecializedActionToCardWhileInPlay  = doSpecializedActionToCardWhileInPlay;
 }