source: trunk/OpenYahtzee/src/HighScoreTableDB.h @ 5

Last change on this file since 5 was 5, checked in by guyru, 7 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 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/**\file HighScoreTableDB.h
21 *\brief Header file for HighScoreTableDB class.
22 *
23 * This file contains the header for the SettingsDB class and all the nessecery include files.
24*/
25
26/// HighScoreTableDB - a class for the management of highscore tables.
27/**
28HighScoreTableDB is designed to handle all the managment and keeping of an high-score table.
29This will be pretty generic class with some specific setting for the class in the beginning of it's definitions.
30*/
31
32#include "DBwrapper.h"
33#include "wx/filename.h"
34
35
36#ifndef HIGHSCORETABLEDB_INC
37#define HIGHSCORETABLEDB_INC
38
39///Sets the file name of the database the class will open. The directory will always be the home dir.
40#define DBFILENAME ".OpenYahtzee"
41class HighScoreTableDB : public DBwrapper
42{
43public:
44        HighScoreTableDB();
45        ~HighScoreTableDB();
46        int IsHighScore(int score); //return the place or return zero if outside the table.
47        int SendHighScore(std::string name, std::string date, int score);
48        void SetSize(int size);
49
50        std::list<std::string> GetHighScoreTable();
51private:
52        std::string m_path;
53        void CreateTable();
54        int m_size; ///holds the highscoretable size. -1 for unlimited.
55};
56
57
58#endif
Note: See TracBrowser for help on using the repository browser.