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

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

fixed init of database file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1// $Header$
2/***************************************************************************
3 *   Copyright (C) 2006 by Guy Rutenberg   *
4 *   guyrutenberg@gmail.com   *
5 *                                                                         *
6 *   This program is free software; you can redistribute it and/or modify  *
7 *   it under the terms of the GNU General Public License as published by  *
8 *   the Free Software Foundation; either version 2 of the License, or     *
9 *   (at your option) any later version.                                   *
10 *                                                                         *
11 *   This program is distributed in the hope that it will be useful,       *
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14 *   GNU General Public License for more details.                          *
15 *                                                                         *
16 *   You should have received a copy of the GNU General Public License     *
17 *   along with this program; if not, write to the                         *
18 *   Free Software Foundation, Inc.,                                       *
19 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
20 ***************************************************************************/
21/**\file HighScoreTableDB.h
22 *\brief Header file for HighScoreTableDB class.
23 *
24 * This file contains the header for the SettingsDB class and all the nessecery include files.
25*/
26
27/// HighScoreTableDB - a class for the management of highscore tables.
28/**
29HighScoreTableDB is designed to handle all the managment and keeping of an high-score table.
30This will be pretty generic class with some specific setting for the class in the beginning of it's definitions.
31*/
32
33#include "DBwrapper.h"
34#include "wx/filename.h"
35
36
37#ifndef HIGHSCORETABLEDB_INC
38#define HIGHSCORETABLEDB_INC
39
40///Sets the file name of the database the class will open. The directory will always be the home dir.
41#define DBFILENAME ".OpenYahtzee"
42class HighScoreTableDB : public DBwrapper
43{
44public:
45        HighScoreTableDB();
46        ~HighScoreTableDB();
47        int IsHighScore(int score); //return the place or return zero if outside the table.
48        int SendHighScore(std::string name, std::string date, int score);
49        void SetSize(int size);
50        int GetSize();
51
52        std::list<std::string> GetHighScoreTable();
53private:
54        std::string m_path;
55        void CreateTable();
56        int m_size; ///holds the highscoretable size. -1 for unlimited.
57};
58
59
60#endif
Note: See TracBrowser for help on using the repository browser.