Example #1
0
 protected Card(CardCost cost)
 {
     Id           = Guid.NewGuid();
     Cost         = cost;
     _currentZone = new NullZone();
     _zoneChanger = zone => _currentZone = zone;
 }
Example #2
0
 protected Card(CardCost cost)
 {
     Id = Guid.NewGuid();
     Cost = cost;
     _currentZone = new NullZone();
     _zoneChanger = zone => _currentZone = zone;            
 }
Example #3
0
 public void MoveTop(int count, CardZone cardZone)
 {
     count.Times(() =>
     {
         if (TopCard != null) 
             TopCard.MoveTo(cardZone);
     });                       
 }
Example #4
0
        public void MoveAll(CardZone targetZone)
        {
            var allCards = new List <ICard>(_cards);

            foreach (Card c in allCards)
            {
                c.MoveTo(targetZone);
            }
        }
Example #5
0
        public void MoveWhere(Func <ICard, bool> predicate, CardZone targetZone)
        {
            var matchingCards = _cards.Where(predicate).ToList();

            foreach (Card c in matchingCards)
            {
                c.MoveTo(targetZone);
            }
        }
Example #6
0
 public void MoveTop(int count, CardZone cardZone)
 {
     count.Times(() =>
     {
         if (TopCard != null)
         {
             TopCard.MoveTo(cardZone);
         }
     });
 }
Example #7
0
 public virtual void MoveCard(Card card, CardZone targetZone, CardZoneChanger changer)
 {
     RemoveCard(card);
     targetZone.AddCard(card);
     changer(targetZone);
 }
Example #8
0
 public int Score(CardZone allCards)
 {
     return Value;
 }
Example #9
0
 public void MoveWhere(Func<ICard, bool> predicate, CardZone targetZone)
 {
     var matchingCards = _cards.Where(predicate).ToList();
     foreach (Card c in matchingCards)
         c.MoveTo(targetZone);
 }
Example #10
0
 public void SetUp()
 {
     _zone1 = new CardZone();
     _zone2 = new CardZone();
     _card = new Copper();
 }
Example #11
0
 public void MoveTo(CardZone targetZone)
 {
     _currentZone.MoveCard(this, targetZone, _zoneChanger);
 }
Example #12
0
 public void MoveCards(CardZone cardZone, int count)
 {
     count.Times(() => TopCard.MoveTo(cardZone));
 }
Example #13
0
 public void MoveAll(CardZone targetZone)
 {
     var allCards = new List<ICard>(_cards);
     foreach (Card c in allCards)
         c.MoveTo(targetZone);
 }
Example #14
0
 public void MoveTo(CardZone targetZone)
 {
     _currentZone.MoveCard(this, targetZone, _zoneChanger);            
 }
Example #15
0
 public void MoveCards(CardZone cardZone, int count)
 {
     count.Times(() => TopCard.MoveTo(cardZone));
 }
Example #16
0
 public int Score(CardZone allCards)
 {
     return 2;
 }
Example #17
0
 public virtual void MoveCard(Card card, CardZone targetZone, CardZoneChanger changer)
 {
     RemoveCard(card);
     targetZone.AddCard(card);
     changer(targetZone);
 }