Пример #1
0
 protected Card(CardCategory category, int cost, int pointValue)
 {
     _currentZone = new NullZone();
     _zoneChanger = zone => _currentZone = zone;
     Category = category;
     Cost = cost;
     PointValue = pointValue;
 }
Пример #2
0
 public void MoveAllCards(CardZone targetZone)
 {
     var tempCards = new List<Card>(this.Cards);
     tempCards.Each(c => c.MoveTo(targetZone));
 }
Пример #3
0
 public void MoveTo(CardZone targetZone)
 {
     _currentZone.MoveCard(this, targetZone, _zoneChanger);
     _currentZone = targetZone;
 }
Пример #4
0
 public virtual void MoveCard(Card card, CardZone targetZone, CardZoneChanger changer)
 {
     RemoveCard(card);
     targetZone.AddCard(card);
     changer(targetZone);
 }
Пример #5
0
 public void MoveAll(CardZone targetZone)
 {
     IList<Card> allCards = new List<Card>(this._cards);
     foreach(Card c in allCards)
         c.MoveTo(targetZone);
 }
Пример #6
0
 public void SetUp()
 {
     _zone1 = new CardZone();
     _zone2 = new CardZone();
     _card = new DummyCard();
 }