source: trunk/OpenYahtzee/src/MainFrame.h @ 9

Last change on this file since 9 was 9, checked in by guyru, 8 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/***************************************************************************
2 *   Copyright (C) 2006 by Guy Rutenberg   *
3 *   guy@Guy_Computer   *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU General Public License as published by  *
7 *   the Free Software Foundation; either version 2 of the License, or     *
8 *   (at your option) any later version.                                   *
9 *                                                                         *
10 *   This program is distributed in the hope that it will be useful,       *
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13 *   GNU General Public License for more details.                          *
14 *                                                                         *
15 *   You should have received a copy of the GNU General Public License     *
16 *   along with this program; if not, write to the                         *
17 *   Free Software Foundation, Inc.,                                       *
18 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19 ***************************************************************************/
20
21 /***********************************************
22 *      This File contains the declaration      *
23 *      of the class MainFrame                  *
24 ***********************************************/
25#include "SettingsDB.h"
26#include "HighScoreTableDB.h"
27#ifndef MAINFRAME_INC
28#define MAINFRAME_INC
29
30// Declare our main frame class
31class MainFrame : public wxFrame
32{
33public:
34        // Constructor
35        MainFrame(const wxString& title,  const wxSize& size, long style);
36
37        // Event handlers
38        void OnQuit(wxCommandEvent& event);
39        void OnAbout(wxCommandEvent& event);
40        void OnNewGame (wxCommandEvent& event);
41        void OnShowHighscore (wxCommandEvent& event);
42        void OnSettings (wxCommandEvent& event);
43
44        void OnRollButton (wxCommandEvent& event);
45        void OnUpperButtons (wxCommandEvent& event);
46        void On3ofakindButton (wxCommandEvent& event);
47        void On4ofakindButton (wxCommandEvent& event); 
48        void OnFullHouseButton (wxCommandEvent& event);
49        void OnSmallSequenceButton (wxCommandEvent& event);
50        void OnLargeSequenceButton (wxCommandEvent& event);
51        void OnYahtzeeButton (wxCommandEvent& event);
52        void OnChanceButton (wxCommandEvent& event);
53
54       
55
56private:
57        void ClearDiceHash();
58        void ResetRolls();
59        void YahtzeeBonus();
60        void EndofGame();
61        void HighScoreHandler(int score);
62
63        //pointers to hold bitmap data for the dices
64        wxBitmap *bitmap_dices[6];
65
66        short int dice[5];      //holds the dices score
67        short int dicehash[6];  //the dice hash
68        short int m_rolls;      //holds how many rolls left
69        short int m_numofplaysleft; //holds how many times the user got to score untill the end of the game
70        bool m_yahtzee;
71
72        SettingsDB *m_settingsdb; ///handles the settings database
73        HighScoreTableDB *m_highscoredb; ///handles the highscore database managment
74
75};
76#endif
Note: See TracBrowser for help on using the repository browser.