///////////////////////////////////////////////////////////////////////////// // Name: game.h // tag: Header for a bridge window with all the visuals // Author: David Roundy // Modified by: // Created: 9/2001 // Copyright: (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 _GAME_H_ #define _GAME_H_ #include "seats.h" #include "card.h" #include "gameevent.h" class Card; class Pack; class Pile; class Hand; class Player; class BidWindow; class aBridgeScoreBase; #define MAX_BIDS 324 class aBridgeGame: public wxPanel { public: aBridgeGame(wxWindow* parent, int x, int y, int w, int h); virtual ~aBridgeGame(); //virtual void OnDraw(wxDC& dc); bool OnCloseGame(); void OnMouseEvent(wxMouseEvent& event); void SetTalkFocus(wxFocusEvent& evt); bool HandleSit(const wxString& who, Seat seat, bool bootable=false); void HandleMySit(const wxString& whoami, Seat seat, bool bootable=false); void HandleGetUp(Seat seat); void HandleBid(const wxString& who, const wxString& what); void HandleBidFinished(); void HandleClaim(const wxString& who, const wxString& what); void HandleClaimAccept(const wxString& what); void HandlePlay(const wxString& who, const wxString& what); void ProcessGameEvent(GameEvent &evt); void CardClicked(wxString cardstr); void CardDealt(const wxString &str); void DealDone(); void Claim(); void NewHand(); void NewRubber(); void HandDone(); void DoPlayCard(Seat seat, Card card); void LButtonDown(wxDC& dc, int mx, int my); // void LButtonDblClk(wxDC& dc, int mx, int my); void HandleResize(wxSizeEvent& event); void SendEvent(const wxString &type, const wxString &msg); bool IsLegal(const Card &card); Seat TrickWinner(); void TableMoved(); Seat DealerSeat() { return m_dealer_seat; } void SetDealerSeat(Seat s); aBridgeScoreBase *GetScores(); DECLARE_EVENT_TABLE() private: void DebugSeatInfo(); wxFont* m_font; wxString m_names[4]; bool m_played_by_me[4]; Player *m_player[4]; Hand *m_hands[4]; wxCard *m_played[4]; bool m_hand_visible[4]; bool m_hand_known[4]; int m_played_number; int m_ns_tricks, m_ew_tricks; bool m_is_dealt; bool m_is_bid; Seat m_whose_turn; Seat m_whose_lead; Suit m_trump; wxStaticText *m_ns_trick_text; wxStaticText *m_ew_trick_text; wxStaticText *m_bid_text; // Bidding stuff. Seat m_dealer_seat, m_dummy_seat; Seat DeclarerSeat() { return AcrossFrom(m_dummy_seat); }; signed char m_bid_values[MAX_BIDS]; Suit m_bid_suits[MAX_BIDS]; int m_num_bids; bool m_is_doubled; bool m_is_redoubled; wxString m_bid_str; int m_current_bid_val; Suit m_current_bid_suit; Seat m_current_bid_winner; BidWindow *m_bid_window; // Scoring stuff: aBridgeScoreBase *m_scorer; }; #endif