protected Card(CardCost cost) { Id = Guid.NewGuid(); Cost = cost; _currentZone = new NullZone(); _zoneChanger = zone => _currentZone = zone; }
public void MoveTop(int count, CardZone cardZone) { count.Times(() => { if (TopCard != null) TopCard.MoveTo(cardZone); }); }
public void MoveAll(CardZone targetZone) { var allCards = new List <ICard>(_cards); foreach (Card c in allCards) { c.MoveTo(targetZone); } }
public void MoveWhere(Func <ICard, bool> predicate, CardZone targetZone) { var matchingCards = _cards.Where(predicate).ToList(); foreach (Card c in matchingCards) { c.MoveTo(targetZone); } }
public void MoveTop(int count, CardZone cardZone) { count.Times(() => { if (TopCard != null) { TopCard.MoveTo(cardZone); } }); }
public virtual void MoveCard(Card card, CardZone targetZone, CardZoneChanger changer) { RemoveCard(card); targetZone.AddCard(card); changer(targetZone); }
public int Score(CardZone allCards) { return Value; }
public void MoveWhere(Func<ICard, bool> predicate, CardZone targetZone) { var matchingCards = _cards.Where(predicate).ToList(); foreach (Card c in matchingCards) c.MoveTo(targetZone); }
public void SetUp() { _zone1 = new CardZone(); _zone2 = new CardZone(); _card = new Copper(); }
public void MoveTo(CardZone targetZone) { _currentZone.MoveCard(this, targetZone, _zoneChanger); }
public void MoveCards(CardZone cardZone, int count) { count.Times(() => TopCard.MoveTo(cardZone)); }
public void MoveAll(CardZone targetZone) { var allCards = new List<ICard>(_cards); foreach (Card c in allCards) c.MoveTo(targetZone); }
public int Score(CardZone allCards) { return 2; }