Ejemplo n.º 1
0
        void player_CardBought(object sender, CardBuyEventArgs e)
        {
            // Already been cancelled or processed -- don't need to process this one
            if (e.Cancelled || e.HandledBy.Contains(this))
            {
                return;
            }

            e.HandledBy.Add(this);

            (sender as Player).AddToken(new CoinToken());
        }
Ejemplo n.º 2
0
		protected override ChoiceResult Decide_CardBuy(Choice choice, CardBuyEventArgs cbea, IEnumerable<Type> cardTriggerTypes)
		{
			Type cardType = cardTriggerTypes.FirstOrDefault(t =>
				t == Cards.Seaside.TypeClass.EmbargoToken || t == Cards.Prosperity.TypeClass.Hoard ||
				t == Cards.Prosperity.TypeClass.Mint || t == Cards.Prosperity.TypeClass.Talisman ||
				t == Cards.Hinterlands.TypeClass.Farmland || t == Cards.Hinterlands.TypeClass.Haggler ||
				t == Cards.Hinterlands.TypeClass.NobleBrigand || t == Cards.Guilds.TypeClass.Doctor ||
				t == Cards.Guilds.TypeClass.Herald || t == Cards.Guilds.TypeClass.Masterpiece ||
				t == Cards.Guilds.TypeClass.Stonemason);

			if (cardType != null)
				return new ChoiceResult(new List<String>() { cbea.Actions[cardType].Text });

			return base.Decide_CardBuy(choice, cbea, cardTriggerTypes);
		}