| 1 | // $Header$ |
|---|
| 2 | /*************************************************************************** |
|---|
| 3 | * Copyright (C) 2006 by Guy Rutenberg * |
|---|
| 4 | * guy@Guy_Computer * |
|---|
| 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 | /** |
|---|
| 29 | HighScoreTableDB is designed to handle all the managment and keeping of an high-score table. |
|---|
| 30 | This 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" |
|---|
| 42 | class HighScoreTableDB : public DBwrapper |
|---|
| 43 | { |
|---|
| 44 | public: |
|---|
| 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 | |
|---|
| 51 | std::list<std::string> GetHighScoreTable(); |
|---|
| 52 | private: |
|---|
| 53 | std::string m_path; |
|---|
| 54 | void CreateTable(); |
|---|
| 55 | int m_size; ///holds the highscoretable size. -1 for unlimited. |
|---|
| 56 | }; |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | #endif |
|---|