/*
 * Game.h
 *
 *  Created on: 2009-07-10
 *      Author: wasyl
 */

#ifndef GAME_H_
#define GAME_H_

#include "Avatar.h"
#include "Level.h"

class Game
{
public:
	enum CounterType {GARBAGE, TIME, JUMPS, DOUBLE_JUMPS, THROWS, KILLS, TRAVERSED, MAX};

private:
	Level *mLevel;
	Avatar *mAvatar;

	static Game *sGame;

	double counters[MAX];

public:
	Game();
	~Game();

	static Game *get() { return sGame; }
	static void set(Game *game) { sGame = game; }

	Level *level() { return mLevel; }
	Avatar *avatar() { return mAvatar; }
	void setAvatar(Avatar *a) { mAvatar = a; }

	double dbCounter(CounterType type) { return counters[type]; }
	int counter(CounterType type) { return (int)counters[type]; }
	void count(CounterType type, double howMuch) { counters[type] += howMuch; };
};

#endif /* GAME_H_ */
