//***************************************************************************
 // Private Methods
 //
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         this._collection = null;
         this._curVal     = default(TCard);
     }
 }
Пример #2
0
        public void AssignName(CardPile <TCard> value, string name)
        {
            if (!this.Contains(value))
            {
                throw new ArgumentException("Specified CardPile was not found in collection.");
            }

            this.AssignName(this.IndexOf(value), name);
        }
Пример #3
0
        public CardPile <TCard>[] Deal(int playerCount, int cardsPerPile)
        {
            CardPile <TCard>[] piles = new CardPile <TCard> [playerCount];
            for (int i = 0; i < piles.Length; i++)
            {
                piles[i] = new CardPile <TCard>();
            }

            this.Deal(ref piles, cardsPerPile);
            return(piles);
        }
 //***************************************************************************
 // Class Constructors
 //
 internal CardPileEnumerator(CardPile <TCard> collection)
 {
     this._collection = collection;
     this._curIdx     = -1;
     this._curVal     = default(TCard);
 }
 protected virtual void InitPlayer(int idx, string name, CardPile <TCard> hand)
 {
     this._players[idx] = new Player <TDeck, TCard>(name, hand, this);
 }
Пример #6
0
 public void MoveCardsToPile(CardPile <TCard> pile)
 {
     pile.AddCards((TCard[])this._arrCards.ToArray(typeof(TCard)));
     this._arrCards.Clear();
 }
Пример #7
0
 public void PlayTopCard(CardPile <TCard> pile)
 {
     pile.AddCard((TCard)this._arrCards[0]);
     this._arrCards.RemoveAt(0);
 }
Пример #8
0
 public Player(string name, CardPile <TCard> hand, IGameEngine <TDeck, TCard> game)
 {
     this._nm   = name;
     this._hand = hand;
     this._game = game;
 }
Пример #9
0
 public void MoveCard(int index, CardPile <TCard> pile)
 {
     pile.AddCardOnTop(this[index]);
     this._cards.RemoveAt(index);
 }
Пример #10
0
 public void MoveTopCard(CardPile <TCard> pile)
 {
     this.MoveCard(0, pile);
 }
Пример #11
0
 //***************************************************************************
 // Public Methods
 //
 public void AddPile(CardPile <TCard> pile)
 {
     this._cards.AddRange(pile._cards);
     pile._cards.Clear();
 }
Пример #12
0
 public void Add(CardPile <TCard> value, string name)
 {
     base.Add(value, name);
 }
Пример #13
0
 //***************************************************************************
 // Public Methods
 //
 public void Add(CardPile <TCard> value)
 {
     base.Add(value, null);
 }