using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ch11CardLib
{
public class Cards : CollectionBase
{
public void Add(Card newCard)
{
List.Add(newCard);
}
public void Remove(Card oldCard)
{
List.Remove(oldCard);
}
public Cards()
{}
public Card this[int cardIndex]
{
get
{
return (Card)List[cardIndex];
}
set
{
List[cardIndex] = value;}
}
public void CopyTo(Cards targetCards)
{
for (int index = 0; index < this.Count; index++) //this是指索引数组的吗?
{targetCards[index] = this[index];} //此行代码看不懂,帮忙解释下
}
public bool Contains(Card card)//此行代码用意?
{
return InnerList.Contains(card); //此行代码innerlist意思是?
}
}