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
c3a11a57 sago007 2016-03-06 11:21 20
http://www.blockattack.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
89c4a3a6 sago007 2008-08-29 14:32 24
89c4a3a6 sago007 2008-08-29 14:32 25
#ifndef _STATS_H
89c4a3a6 sago007 2008-08-29 14:32 26
#define	_STATS_H
89c4a3a6 sago007 2008-08-29 14:32 27
89c4a3a6 sago007 2008-08-29 14:32 28
#include <map>
89c4a3a6 sago007 2008-08-29 14:32 29
#include <string>
89c4a3a6 sago007 2008-08-29 14:32 30
89c4a3a6 sago007 2008-08-29 14:32 31
class Stats
89c4a3a6 sago007 2008-08-29 14:32 32
{
89c4a3a6 sago007 2008-08-29 14:32 33
public:
c53e6443 sago007 2012-04-17 11:04 34
c53e6443 sago007 2012-04-17 11:04 35
	static Stats* getInstance();
c53e6443 sago007 2012-04-17 11:04 36
c53e6443 sago007 2012-04-17 11:04 37
	void save();
c53e6443 sago007 2012-04-17 11:04 38
53001fa2 sago007 2015-11-08 15:13 39
	unsigned int getNumberOf(const std::string &statName);
c53e6443 sago007 2012-04-17 11:04 40
53001fa2 sago007 2015-11-08 15:13 41
	void addOne(const std::string &statName);
c53e6443 sago007 2012-04-17 11:04 42
53001fa2 sago007 2015-11-08 15:13 43
	bool exists(const std::string &statName);
c53e6443 sago007 2012-04-17 11:04 44
6c28b502 sago007 2016-02-13 11:38 45
private:
6c28b502 sago007 2016-02-13 11:38 46
	std::map<std::string,unsigned int> statMap;
6c28b502 sago007 2016-02-13 11:38 47
	static Stats *instance;
6c28b502 sago007 2016-02-13 11:38 48
	void load();
6c28b502 sago007 2016-02-13 11:38 49
	Stats();
89c4a3a6 sago007 2008-08-29 14:32 50
};
89c4a3a6 sago007 2008-08-29 14:32 51
89c4a3a6 sago007 2008-08-29 14:32 52
#endif	/* _STATS_H */
89c4a3a6 sago007 2008-08-29 14:32 53
1970-01-01 00:00 54