///////////////////////////////////////////////////////////////////////////// // Name: cards.h // tag: header for the packs and piles and whatnot // Author: Chris Breeze // Modified by: David Roundy // Created: 21/07/97 // Copyright: (c) 1993-1998 Chris Breeze // (c) 2001 David Roundy // Licence: GPL /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ///////////////////////////////////////////////////////////////////////////// #ifndef _CARDS_H_ #define _CARDS_H_ #include "card.h" //----------------------------// // A class which holds a hand // //----------------------------// class Hand : public wxControl { public: Hand(int is_vertical = 1, wxWindow* parent = NULL, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); ~Hand(); void PlayCard(const Card &card); // Remove card. void AddCard(const Card &card); // Add card to top of pile void TurnCards(WayUp); void ResetHand(); wxString GetString(const wxString &sep=" ", const wxString &end=""); inline void Erase(wxDC &) { Refresh(); }; inline void Redraw(wxDC &) { Refresh(); }; void HandleResize(wxSizeEvent& event); virtual wxSize GetBestSize() const; void OnClick(wxMouseEvent& event); void DoPaint(wxPaintEvent& event); void GetDeltaSize(int *x, int *y, int *dx, int *dy, int *w, int *h) const; int GetNumCards() const; bool HasCard(const Card &card) const; bool HasSuit(Suit suit) const; inline bool Empty() const { return the_cards == NULL; }; DECLARE_EVENT_TABLE() private: Card *the_cards; int m_vertical; }; #endif // _CARDS_H_