git repos / blockattack-game

blame: source/code/stats.h

normal view · raw

89c4a3a6 sago007 2008-08-29 14:32 1
/*
c53e6443 sago007 2012-04-17 11:04 2
===========================================================================
c53e6443 sago007 2012-04-17 11:04 3
blockattack - Block Attack - Rise of the Blocks
c53e6443 sago007 2012-04-17 11:04 4
Copyright (C) 2005-2012 Poul Sander
c53e6443 sago007 2012-04-17 11:04 5
c53e6443 sago007 2012-04-17 11:04 6
This program is free software: you can redistribute it and/or modify
c53e6443 sago007 2012-04-17 11:04 7
it under the terms of the GNU General Public License as published by
c53e6443 sago007 2012-04-17 11:04 8
the Free Software Foundation, either version 2 of the License, or
c53e6443 sago007 2012-04-17 11:04 9
(at your option) any later version.
c53e6443 sago007 2012-04-17 11:04 10
c53e6443 sago007 2012-04-17 11:04 11
This program is distributed in the hope that it will be useful,
c53e6443 sago007 2012-04-17 11:04 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
c53e6443 sago007 2012-04-17 11:04 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c53e6443 sago007 2012-04-17 11:04 14
GNU General Public License for more details.
c53e6443 sago007 2012-04-17 11:04 15
c53e6443 sago007 2012-04-17 11:04 16
You should have received a copy of the GNU General Public License
c53e6443 sago007 2012-04-17 11:04 17
along with this program.  If not, see http://www.gnu.org/licenses/
c53e6443 sago007 2012-04-17 11:04 18
c53e6443 sago007 2012-04-17 11:04 19
Source information and contacts persons can be found at
c53e6443 sago007 2012-04-17 11:04 20
http://blockattack.sf.net
c53e6443 sago007 2012-04-17 11:04 21
===========================================================================
89c4a3a6 sago007 2008-08-29 14:32 22
*/
89c4a3a6 sago007 2008-08-29 14:32 23
c53e6443 sago007 2012-04-17 11:04 24
//
89c4a3a6 sago007 2008-08-29 14:32 25
// File:   stats.h
89c4a3a6 sago007 2008-08-29 14:32 26
// Author: poul
89c4a3a6 sago007 2008-08-29 14:32 27
//
89c4a3a6 sago007 2008-08-29 14:32 28
// Created on 11. februar 2008, 20:19
89c4a3a6 sago007 2008-08-29 14:32 29
//
89c4a3a6 sago007 2008-08-29 14:32 30
89c4a3a6 sago007 2008-08-29 14:32 31
#ifndef _STATS_H
89c4a3a6 sago007 2008-08-29 14:32 32
#define	_STATS_H
89c4a3a6 sago007 2008-08-29 14:32 33
89c4a3a6 sago007 2008-08-29 14:32 34
using namespace std;
89c4a3a6 sago007 2008-08-29 14:32 35
89c4a3a6 sago007 2008-08-29 14:32 36
#include <map>
89c4a3a6 sago007 2008-08-29 14:32 37
#include <string>
89c4a3a6 sago007 2008-08-29 14:32 38
89c4a3a6 sago007 2008-08-29 14:32 39
89c4a3a6 sago007 2008-08-29 14:32 40
89c4a3a6 sago007 2008-08-29 14:32 41
89c4a3a6 sago007 2008-08-29 14:32 42
class Stats
89c4a3a6 sago007 2008-08-29 14:32 43
{
c53e6443 sago007 2012-04-17 11:04 44
private:
c53e6443 sago007 2012-04-17 11:04 45
	map<string,unsigned int> statMap;
c53e6443 sago007 2012-04-17 11:04 46
c53e6443 sago007 2012-04-17 11:04 47
	static Stats *instance;
89c4a3a6 sago007 2008-08-29 14:32 48
c53e6443 sago007 2012-04-17 11:04 49
	void load();
89c4a3a6 sago007 2008-08-29 14:32 50
protected:
c53e6443 sago007 2012-04-17 11:04 51
c53e6443 sago007 2012-04-17 11:04 52
	Stats();
c53e6443 sago007 2012-04-17 11:04 53
c53e6443 sago007 2012-04-17 11:04 54
89c4a3a6 sago007 2008-08-29 14:32 55
public:
c53e6443 sago007 2012-04-17 11:04 56
c53e6443 sago007 2012-04-17 11:04 57
	static Stats* getInstance();
c53e6443 sago007 2012-04-17 11:04 58
c53e6443 sago007 2012-04-17 11:04 59
	void save();
c53e6443 sago007 2012-04-17 11:04 60
af35c39d sago007 2013-11-16 16:37 61
	unsigned int getNumberOf(const string &statName);
c53e6443 sago007 2012-04-17 11:04 62
af35c39d sago007 2013-11-16 16:37 63
	void addOne(const string &statName);
c53e6443 sago007 2012-04-17 11:04 64
af35c39d sago007 2013-11-16 16:37 65
	bool exists(const string &statName);
c53e6443 sago007 2012-04-17 11:04 66
c53e6443 sago007 2012-04-17 11:04 67
89c4a3a6 sago007 2008-08-29 14:32 68
};
89c4a3a6 sago007 2008-08-29 14:32 69
89c4a3a6 sago007 2008-08-29 14:32 70
#endif	/* _STATS_H */
89c4a3a6 sago007 2008-08-29 14:32 71
1970-01-01 00:00 72