//*************************************************************************** // Private Methods // private void Dispose(bool disposing) { if (disposing) { this._collection = null; this._curVal = default(TCard); } }
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); }
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); }
public void MoveCardsToPile(CardPile <TCard> pile) { pile.AddCards((TCard[])this._arrCards.ToArray(typeof(TCard))); this._arrCards.Clear(); }
public void PlayTopCard(CardPile <TCard> pile) { pile.AddCard((TCard)this._arrCards[0]); this._arrCards.RemoveAt(0); }
public Player(string name, CardPile <TCard> hand, IGameEngine <TDeck, TCard> game) { this._nm = name; this._hand = hand; this._game = game; }
public void MoveCard(int index, CardPile <TCard> pile) { pile.AddCardOnTop(this[index]); this._cards.RemoveAt(index); }
public void MoveTopCard(CardPile <TCard> pile) { this.MoveCard(0, pile); }
//*************************************************************************** // Public Methods // public void AddPile(CardPile <TCard> pile) { this._cards.AddRange(pile._cards); pile._cards.Clear(); }
public void Add(CardPile <TCard> value, string name) { base.Add(value, name); }
//*************************************************************************** // Public Methods // public void Add(CardPile <TCard> value) { base.Add(value, null); }