private bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); if (parameters.TargetPlayer.Hand.Count < 3) { return(false); } List <ICard> cardsToReturn = parameters.TargetPlayer.PickMultipleCards(parameters.TargetPlayer.Hand, 3, 3).ToList(); if (cardsToReturn.Count == 0) { return(false); } foreach (ICard card in cardsToReturn) { parameters.TargetPlayer.Hand.Remove(card); Return.Action(card, parameters.Game); } Meld.Action(Draw.Action(3, parameters.Game), parameters.TargetPlayer); return(true); }
private bool Action2(CardActionParameters parameters) { ValidateParameters(parameters); List <ICard> ageThreeCardsInHand = parameters.TargetPlayer.Hand.Where(x => x.Age == 3).ToList(); if (ageThreeCardsInHand.Count == 0) { return(false); } ICard cardToReturn = parameters.TargetPlayer.PickCard(ageThreeCardsInHand); if (cardToReturn == null) { return(false); } parameters.TargetPlayer.Hand.Remove(cardToReturn); Return.Action(cardToReturn, parameters.Game); parameters.TargetPlayer.Hand.Add(Draw.Action(1, parameters.Game)); parameters.TargetPlayer.Hand.Add(Draw.Action(1, parameters.Game)); parameters.TargetPlayer.Hand.Add(Draw.Action(1, parameters.Game)); return(true); }
bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); List <ICard> cardsToReturn = parameters.TargetPlayer.PickMultipleCards(parameters.TargetPlayer.Hand, 0, parameters.TargetPlayer.Hand.Count).ToList(); if (cardsToReturn.Count == 0) { return(false); } foreach (ICard card in cardsToReturn) { parameters.TargetPlayer.Hand.Remove(card); Return.Action(card, parameters.Game); } int differentAges = cardsToReturn.Select(x => x.Age).Distinct().Count(); for (int i = 0; i < differentAges; i++) { Score.Action(Draw.Action(2, parameters.Game), parameters.TargetPlayer); } return(true); }
bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); //Draw and reveal a [4] for every three [TOWER] on your board. var cardsDrawn = new List <ICard>(); var numberOfCardsToDraw = parameters.TargetPlayer.Tableau.GetSymbolCount(Symbol.Tower) / 3; if (numberOfCardsToDraw == 0) { return(false); } for (int i = 0; i < numberOfCardsToDraw; i++) { ICard card = Draw.Action(4, parameters.Game); parameters.TargetPlayer.RevealCard(card); parameters.TargetPlayer.Hand.Add(card); cardsDrawn.Add(card); } //If any of the drawn cards are red, return the cards drawn and return all cards in your hand. Otherwise, keep them. if (cardsDrawn.Any(c => c.Color == Color.Red)) { parameters.TargetPlayer.Hand.ForEach(c => Return.Action(c, parameters.Game)); parameters.TargetPlayer.Hand.RemoveRange(0, parameters.TargetPlayer.Hand.Count()); } return(true); }
bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); var selectedCard = parameters.TargetPlayer.PickCardFromHand(); if (selectedCard == null) { return(false); } Return.Action(selectedCard, parameters.Game); if (!selectedCard.Age.Equals(10)) { return(true); } for (var i = 0; i < parameters.TargetPlayer.Tableau.ScorePile.Select(c => c.Age).Distinct().Count(); i++) { Draw.Action(10, parameters.Game); } return(true); }
public void ReturnAction_Base() { Return.Action(testCard, testGame); Assert.AreEqual(testCard, testGame.AgeDecks[0].Cards[1]); Assert.AreEqual(2, testGame.AgeDecks[0].Cards.Count); Assert.AreEqual(1, testGame.AgeDecks[1].Cards.Count); }
bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); var selectedCard = parameters.TargetPlayer.PickCard(parameters.TargetPlayer.Tableau.GetTopCards().Where(c => c.HasSymbol(Symbol.Leaf))); Return.Action(selectedCard, parameters.Game); return(false); }
bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); var selectedCards = parameters.TargetPlayer.PickMultipleCards(parameters.TargetPlayer.Tableau.ScorePile, (int)Math.Ceiling(parameters.TargetPlayer.Tableau.ScorePile.Count / 2.0d), (int)Math.Ceiling(parameters.TargetPlayer.Tableau.ScorePile.Count / 2.0d)).ToList(); selectedCards.ForEach(c => Return.Action(c, parameters.Game)); return(false); }
bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); ICard card = parameters.TargetPlayer.PickCardFromHand(); if (card == null) { return(false); } parameters.TargetPlayer.Hand.Remove(card); Return.Action(card, parameters.Game); Meld.Action(Draw.Action(card.Age + 1, parameters.Game), parameters.TargetPlayer); return(true); }
private bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); var selectedCards = parameters.TargetPlayer.PickMultipleCards(parameters.TargetPlayer.Hand, 0, 3).ToList(); if (selectedCards.Count == 0) { return(false); } foreach (ICard card in selectedCards) { parameters.TargetPlayer.Hand.Remove(card); Return.Action(card, parameters.Game); } Score.Action(Draw.Action(selectedCards.Count, parameters.Game), parameters.TargetPlayer); return(true); }
private bool Action1(CardActionParameters parameters) { ValidateParameters(parameters); ICard selectedCard = parameters.TargetPlayer.PickCardFromHand(); if (selectedCard == null) { return(false); } parameters.TargetPlayer.Hand.Remove(selectedCard); Return.Action(selectedCard, parameters.Game); int ageToDraw = selectedCard.Age + 1; var cardToScore = Draw.Action(ageToDraw, parameters.Game); Score.Action(cardToScore, parameters.TargetPlayer); return(true); }