libkdegames/kggzmod
statistics.cpp
Go to the documentation of this file.00001 /* 00002 This file is part of the kggzmod library. 00003 Copyright (c) 2005 - 2007 Josef Spillner <josef@ggzgamingzone.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #include "statistics.h" 00022 #include "statistics_private.h" 00023 00024 using namespace KGGZMod; 00025 00026 Statistics::Statistics() 00027 { 00028 d = new StatisticsPrivate(); 00029 00030 d->wins = -1; 00031 d->losses = -1; 00032 d->ties = -1; 00033 d->forfeits = -1; 00034 d->rating = -1; 00035 d->ranking = -1; 00036 d->highscore = -1; 00037 00038 d->hasrecord = false; 00039 d->hasranking = false; 00040 d->hasrating = false; 00041 d->hashighscore = false; 00042 } 00043 00044 Statistics::~Statistics() 00045 { 00046 delete d; 00047 } 00048 00049 int Statistics::wins() const 00050 { 00051 return d->wins; 00052 } 00053 00054 int Statistics::losses() const 00055 { 00056 return d->losses; 00057 } 00058 00059 int Statistics::ties() const 00060 { 00061 return d->ties; 00062 } 00063 00064 int Statistics::forfeits() const 00065 { 00066 return d->forfeits; 00067 } 00068 00069 int Statistics::rating() const 00070 { 00071 return d->rating; 00072 } 00073 00074 int Statistics::ranking() const 00075 { 00076 return d->ranking; 00077 } 00078 00079 int Statistics::highscore() const 00080 { 00081 return d->highscore; 00082 } 00083 00084 bool Statistics::hasRecord() const 00085 { 00086 return d->hasrecord; 00087 } 00088 00089 bool Statistics::hasRating() const 00090 { 00091 return d->hasrating; 00092 } 00093 00094 bool Statistics::hasRanking() const 00095 { 00096 return d->hasranking; 00097 } 00098 00099 bool Statistics::hasHighscore() const 00100 { 00101 return d->hashighscore; 00102 } 00103 00104 void Statistics::init(StatisticsPrivate *x) 00105 { 00106 delete d; 00107 d = x; 00108 } 00109
KDE 4.0 API Reference