Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CardPile Class Reference

#include </home/clem/local/src/opie/noncore/games/solitaire/cardpile.h>

Inheritance diagram for CardPile:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CardPile (int x, int y)
virtual ~CardPile ()
int getX ()
int getY ()
int getNextX ()
int getNextY ()
int getWidth ()
int getHeight ()
int getOffsetDown ()
int getAnzCardsInPile ()
void setX (int x)
void setY (int y)
void setNextX (int x)
void setNextY (int y)
void setWidth (int width)
void setHeight (int height)
void setOffsetDown (int down)
void beginDealing ()
void endDealing ()
bool isDealing ()
void beginPileResize ()
void endPileResize ()
bool isPileResize ()
int distanceFromPile (int x, int y)
int distanceFromNextPos (int x, int y)
CardcardOnTop ()
CardcardOnBottom ()
CardcardInfront (Card *c)
bool kingOnTop ()
bool addCardToTop (Card *c)
bool addCardToBottom (Card *c)
bool removeCard (Card *c)
virtual void cardAddedToTop (Card *)
virtual void cardAddedToBottom (Card *)
virtual void cardRemoved (Card *)
virtual bool isAllowedOnTop (Card *)
virtual bool isAllowedOnBottom (Card *)
virtual bool isAllowedToBeMoved (Card *)
virtual QPoint getCardPos (Card *)
virtual QPoint getHypertheticalNextCardPos ()
void writeConfig (Config &cfg, QString name)

Protected Attributes

int pileX
int pileY
int pileNextX
int pileNextY
int pileWidth
int pileHeight
int pileCenterX
int pileCenterY
int pileRadius
int pileOffsetDown

Private Attributes

bool dealing
bool PileResize

Constructor & Destructor Documentation

CardPile::CardPile int  x,
int  y
 

Definition at line 28 of file cardpile.cpp.

References pileCenterX, pileCenterY, pileHeight, pileNextX, pileNextY, pileOffsetDown, pileRadius, pileWidth, pileX, and pileY.

virtual CardPile::~CardPile  )  [inline, virtual]
 

Definition at line 48 of file cardpile.h.


Member Function Documentation

bool CardPile::addCardToBottom Card c  ) 
 

Definition at line 77 of file cardpile.cpp.

References cardAddedToBottom(), dealing, FALSE, isAllowedOnBottom(), and TRUE.

bool CardPile::addCardToTop Card c  ) 
 

Definition at line 67 of file cardpile.cpp.

References cardAddedToTop(), dealing, FALSE, isAllowedOnTop(), and TRUE.

Referenced by FreecellCardGame::checkUnusable(), TeeclubCardGame::deal(), PatienceCardGame::deal(), HarpCardGame::deal(), FreecellCardGame::deal(), ChicaneCardGame::deal(), PatienceCardGame::mousePress(), TeeclubCardGame::mousePressCard(), PatienceCardGame::mousePressCard(), HarpCardGame::mousePressCard(), and ChicaneCardGame::mousePressCard().

void CardPile::beginDealing  )  [inline]
 

Definition at line 72 of file cardpile.h.

References dealing, and TRUE.

Referenced by TeeclubWorkingPile::cardAddedToTop(), and TeeclubWorkingPile::cardRemoved().

void CardPile::beginPileResize  )  [inline]
 

Definition at line 76 of file cardpile.h.

References PileResize, and TRUE.

Referenced by TeeclubCardGame::deal(), and TeeclubCardGame::readConfig().

virtual void CardPile::cardAddedToBottom Card  )  [inline, virtual]
 

Definition at line 93 of file cardpile.h.

Referenced by addCardToBottom().

virtual void CardPile::cardAddedToTop Card  )  [inline, virtual]
 

Reimplemented in FreecellWorkingPile, FreecellFreecellPile, PatienceWorkingPile, and TeeclubWorkingPile.

Definition at line 92 of file cardpile.h.

Referenced by addCardToTop().

Card * CardPile::cardInfront Card c  ) 
 

Definition at line 50 of file cardpile.cpp.

References NULL, and p.

Referenced by TeeclubWorkingPile::cardAddedToTop(), TeeclubWorkingPile::cardRemoved(), FreecellCardGame::checkNeeded(), getAnzCardsInPile(), TeeclubWorkingPile::getCardPos(), PatienceWorkingPile::getCardPos(), HarpWorkingPile::getCardPos(), ChicaneWorkingPile::getCardPos(), FreecellWorkingPile::isAllowedOnTop(), TeeclubWorkingPile::isAllowedToBeMoved(), HarpWorkingPile::isAllowedToBeMoved(), FreecellWorkingPile::isAllowedToBeMoved(), ChicaneWorkingPile::isAllowedToBeMoved(), TeeclubCardGame::resizePiles(), and writeConfig().

Card* CardPile::cardOnBottom  )  [inline]
 

Definition at line 84 of file cardpile.h.

Referenced by TeeclubWorkingPile::cardAddedToTop(), FreecellWorkingPile::cardAddedToTop(), TeeclubWorkingPile::cardRemoved(), FreecellCardGame::checkNeeded(), getAnzCardsInPile(), TeeclubWorkingPile::getCardPos(), PatienceWorkingPile::getCardPos(), HarpWorkingPile::getCardPos(), ChicaneWorkingPile::getCardPos(), FreecellWorkingPile::isAllowedOnTop(), TeeclubCardGame::resizePiles(), and writeConfig().

Card* CardPile::cardOnTop  )  [inline]
 

Definition at line 83 of file cardpile.h.

Referenced by TeeclubWorkingPile::cardRemoved(), PatienceWorkingPile::cardRemoved(), HarpWorkingPile::cardRemoved(), FreecellWorkingPile::cardRemoved(), ChicaneWorkingPile::cardRemoved(), FreecellCardGame::checkUnusable(), TeeclubWorkingPile::isAllowedOnTop(), TeeclubDiscardPile::isAllowedOnTop(), PatienceWorkingPile::isAllowedOnTop(), PatienceDiscardPile::isAllowedOnTop(), HarpWorkingPile::isAllowedOnTop(), FreecellFreecellPile::isAllowedOnTop(), FreecellWorkingPile::isAllowedOnTop(), ChicaneWorkingPile::isAllowedOnTop(), PatienceDiscardPile::isAllowedToBeMoved(), PatienceFaceUpDeck::isAllowedToBeMoved(), PatienceFaceDownDeck::isAllowedToBeMoved(), kingOnTop(), PatienceCardGame::mousePress(), TeeclubCardGame::mousePressCard(), HarpCardGame::mousePressCard(), and ChicaneCardGame::mousePressCard().

virtual void CardPile::cardRemoved Card  )  [inline, virtual]
 

Reimplemented in ChicaneWorkingPile, FreecellWorkingPile, FreecellFreecellPile, HarpWorkingPile, PatienceWorkingPile, and TeeclubWorkingPile.

Definition at line 94 of file cardpile.h.

Referenced by removeCard().

int CardPile::distanceFromNextPos int  x,
int  y
 

Definition at line 45 of file cardpile.cpp.

References pileNextX, and pileNextY.

int CardPile::distanceFromPile int  x,
int  y
 

Definition at line 40 of file cardpile.cpp.

References pileCenterX, and pileCenterY.

void CardPile::endDealing  )  [inline]
 

Definition at line 73 of file cardpile.h.

References dealing, and FALSE.

Referenced by TeeclubWorkingPile::cardAddedToTop(), and TeeclubWorkingPile::cardRemoved().

void CardPile::endPileResize  )  [inline]
 

Definition at line 77 of file cardpile.h.

References FALSE, and PileResize.

Referenced by TeeclubCardGame::readConfig().

int CardPile::getAnzCardsInPile  )  [inline]
 

Definition at line 57 of file cardpile.h.

References cardInfront(), cardOnBottom(), and NULL.

virtual QPoint CardPile::getCardPos Card  )  [inline, virtual]
 

Reimplemented in ChicaneWorkingPile, HarpWorkingPile, PatienceWorkingPile, and TeeclubWorkingPile.

Definition at line 98 of file cardpile.h.

References pileX, and pileY.

int CardPile::getHeight  )  [inline]
 

Definition at line 55 of file cardpile.h.

References pileHeight.

virtual QPoint CardPile::getHypertheticalNextCardPos void   )  [inline, virtual]
 

Reimplemented in ChicaneWorkingPile, HarpWorkingPile, PatienceWorkingPile, and TeeclubWorkingPile.

Definition at line 99 of file cardpile.h.

References pileX, and pileY.

Referenced by CanvasCardGame::contentsMouseMoveEvent().

int CardPile::getNextX  )  [inline]
 

Definition at line 52 of file cardpile.h.

References pileNextX.

Referenced by TeeclubWorkingPile::getHypertheticalNextCardPos(), HarpWorkingPile::getHypertheticalNextCardPos(), and ChicaneWorkingPile::getHypertheticalNextCardPos().

int CardPile::getNextY  )  [inline]
 

Definition at line 53 of file cardpile.h.

References pileNextY.

Referenced by TeeclubWorkingPile::getHypertheticalNextCardPos(), HarpWorkingPile::getHypertheticalNextCardPos(), and ChicaneWorkingPile::getHypertheticalNextCardPos().

int CardPile::getOffsetDown  )  [inline]
 

Definition at line 56 of file cardpile.h.

References pileOffsetDown.

Referenced by TeeclubWorkingPile::cardAddedToTop(), and TeeclubWorkingPile::cardRemoved().

int CardPile::getWidth  )  [inline]
 

Definition at line 54 of file cardpile.h.

References pileWidth.

int CardPile::getX void   )  [inline]
 

Definition at line 50 of file cardpile.h.

References pileX.

int CardPile::getY void   )  [inline]
 

Definition at line 51 of file cardpile.h.

References pileY.

virtual bool CardPile::isAllowedOnBottom Card  )  [inline, virtual]
 

Definition at line 96 of file cardpile.h.

References FALSE.

Referenced by addCardToBottom().

virtual bool CardPile::isAllowedOnTop Card  )  [inline, virtual]
 

Reimplemented in ChicaneWorkingPile, FreecellWorkingPile, FreecellFreecellPile, HarpWorkingPile, PatienceFaceDownDeck, PatienceFaceUpDeck, PatienceDiscardPile, PatienceWorkingPile, TeeclubDiscardPile, and TeeclubWorkingPile.

Definition at line 95 of file cardpile.h.

References FALSE.

Referenced by addCardToTop(), CanvasCardGame::contentsMouseMoveEvent(), and CanvasCardGame::contentsMouseReleaseEvent().

virtual bool CardPile::isAllowedToBeMoved Card  )  [inline, virtual]
 

Reimplemented in ChicaneWorkingPile, FreecellWorkingPile, FreecellFreecellPile, HarpWorkingPile, PatienceFaceDownDeck, PatienceFaceUpDeck, PatienceDiscardPile, PatienceWorkingPile, TeeclubDiscardPile, and TeeclubWorkingPile.

Definition at line 97 of file cardpile.h.

References FALSE.

Referenced by removeCard().

bool CardPile::isDealing  )  [inline]
 

Definition at line 74 of file cardpile.h.

References dealing.

Referenced by FreecellWorkingPile::cardAddedToTop(), and FreecellWorkingPile::cardRemoved().

bool CardPile::isPileResize  )  [inline]
 

Definition at line 78 of file cardpile.h.

References PileResize.

Referenced by TeeclubWorkingPile::cardAddedToTop().

bool CardPile::kingOnTop  ) 
 

Definition at line 61 of file cardpile.cpp.

References cardOnTop(), Card::getValue(), and king.

bool CardPile::removeCard Card c  ) 
 

Definition at line 87 of file cardpile.cpp.

References cardRemoved(), dealing, FALSE, isAllowedToBeMoved(), and TRUE.

Referenced by FreecellCardGame::checkUnusable(), PatienceCardGame::mousePress(), TeeclubCardGame::mousePressCard(), PatienceCardGame::mousePressCard(), HarpCardGame::mousePressCard(), and ChicaneCardGame::mousePressCard().

void CardPile::setHeight int  height  )  [inline]
 

Definition at line 69 of file cardpile.h.

References pileHeight.

void CardPile::setNextX int  x  )  [inline]
 

Definition at line 66 of file cardpile.h.

References pileNextX.

Referenced by TeeclubWorkingPile::cardAddedToTop(), PatienceWorkingPile::cardAddedToTop(), TeeclubWorkingPile::cardRemoved(), PatienceWorkingPile::cardRemoved(), HarpWorkingPile::cardRemoved(), and ChicaneWorkingPile::cardRemoved().

void CardPile::setNextY int  y  )  [inline]
 

Definition at line 67 of file cardpile.h.

References pileNextY.

Referenced by TeeclubWorkingPile::cardAddedToTop(), PatienceWorkingPile::cardAddedToTop(), TeeclubWorkingPile::cardRemoved(), PatienceWorkingPile::cardRemoved(), HarpWorkingPile::cardRemoved(), and ChicaneWorkingPile::cardRemoved().

void CardPile::setOffsetDown int  down  )  [inline]
 

Definition at line 70 of file cardpile.h.

References pileOffsetDown.

Referenced by TeeclubWorkingPile::cardAddedToTop(), TeeclubWorkingPile::cardRemoved(), TeeclubCardGame::deal(), and TeeclubCardGame::resizePiles().

void CardPile::setWidth int  width  )  [inline]
 

Definition at line 68 of file cardpile.h.

References pileWidth.

void CardPile::setX int  x  )  [inline]
 

Definition at line 64 of file cardpile.h.

References pileX.

void CardPile::setY int  y  )  [inline]
 

Definition at line 65 of file cardpile.h.

References pileY.

void CardPile::writeConfig Config cfg,
QString  name
 

Definition at line 97 of file cardpile.cpp.

References cardInfront(), cardOnBottom(), Card::getDeckNumber(), Card::getSuit(), Card::getValue(), Card::isFacing(), Config::setGroup(), QString::sprintf(), val, and Config::writeEntry().

Referenced by TeeclubCardGame::writeConfig(), PatienceCardGame::writeConfig(), HarpCardGame::writeConfig(), FreecellCardGame::writeConfig(), and ChicaneCardGame::writeConfig().


Member Data Documentation

bool CardPile::dealing [private]
 

Definition at line 111 of file cardpile.h.

Referenced by addCardToBottom(), addCardToTop(), beginDealing(), endDealing(), isDealing(), and removeCard().

int CardPile::pileCenterX [protected]
 

Definition at line 107 of file cardpile.h.

Referenced by CardPile(), and distanceFromPile().

int CardPile::pileCenterY [protected]
 

Definition at line 107 of file cardpile.h.

Referenced by CardPile(), and distanceFromPile().

int CardPile::pileHeight [protected]
 

Definition at line 106 of file cardpile.h.

Referenced by CardPile(), getHeight(), and setHeight().

int CardPile::pileNextX [protected]
 

Definition at line 105 of file cardpile.h.

Referenced by CardPile(), distanceFromNextPos(), getNextX(), and setNextX().

int CardPile::pileNextY [protected]
 

Definition at line 105 of file cardpile.h.

Referenced by CardPile(), distanceFromNextPos(), getNextY(), and setNextY().

int CardPile::pileOffsetDown [protected]
 

Definition at line 109 of file cardpile.h.

Referenced by CardPile(), getOffsetDown(), and setOffsetDown().

int CardPile::pileRadius [protected]
 

Definition at line 108 of file cardpile.h.

Referenced by CardPile().

bool CardPile::PileResize [private]
 

Definition at line 112 of file cardpile.h.

Referenced by beginPileResize(), endPileResize(), and isPileResize().

int CardPile::pileWidth [protected]
 

Definition at line 106 of file cardpile.h.

Referenced by CardPile(), getWidth(), and setWidth().

int CardPile::pileX [protected]
 

Definition at line 104 of file cardpile.h.

Referenced by CardPile(), TeeclubWorkingPile::cardRemoved(), PatienceWorkingPile::cardRemoved(), HarpWorkingPile::cardRemoved(), ChicaneWorkingPile::cardRemoved(), TeeclubWorkingPile::getCardPos(), PatienceWorkingPile::getCardPos(), HarpWorkingPile::getCardPos(), ChicaneWorkingPile::getCardPos(), getCardPos(), getHypertheticalNextCardPos(), getX(), and setX().

int CardPile::pileY [protected]
 

Definition at line 104 of file cardpile.h.

Referenced by CardPile(), TeeclubWorkingPile::cardRemoved(), PatienceWorkingPile::cardRemoved(), HarpWorkingPile::cardRemoved(), ChicaneWorkingPile::cardRemoved(), TeeclubWorkingPile::getCardPos(), PatienceWorkingPile::getCardPos(), HarpWorkingPile::getCardPos(), ChicaneWorkingPile::getCardPos(), getCardPos(), getHypertheticalNextCardPos(), getY(), and setY().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:28:02 2005 for OPIE by  doxygen 1.4.2