/**** * * Implementation of card-list.h. * */ #include "card-list.h" #include Card* CardList::Find(Id id) { CardListElem* cle; if (cle = (CardListElem*) List::Find((ListElemKey*) id)) return cle->GetData(); else return NULL; } Card* CardList::Enum() { CardListElem* cle = (CardListElem*) List::Enum(); if (cle) return cle->GetData(); else return NULL; } Card* CardList::GetNth(int n) { return (Card*) ((CardListElem*) List::GetNth(n))->GetData(); } CardListElem::CardListElem(Card* c) { this->c = c; } int CardListElem::Compare(ListElem* le) { CardListElem* cle = (CardListElem*) le; return not (c->GetId() == cle->c->GetId()); } int CardListElem::Compare(ListElemKey* k) { return not (c->GetId() == (Id) k); } ListElemKey* CardListElem::GetKey() { return (ListElemKey*) c->GetId(); } Card* CardListElem::GetData() { return (Card*) c; } void CardListElem::Print() { c->Print(); }