/**
 * \file SquareZoneStatistic.h
 * \date 06.03.2005
 * \author Marian Tines
 *
 * Interface for the SquareZoneStatistics class
 */

#include <fstream>

#ifndef SQUARE_ZONE_STATISTIC_H
#define SQUARE_ZONE_STATISTIC_H

enum StatisticsType
{
	FRIEND,
	ENEMY,
	BALL,
	NONE
};

/**
 * \class SquareZoneStatistic
 * \author Marian Tines
 * 
 * Square zone statistic store statistics about the time
 * which where movable object (friend or enemy player and ball)
 * into the specified square zone.
 */
class SquareZoneStatistic
{
private:
	int friendPlayerInTheZone;
	int enemyPlayerInTheZone;
	int ballInTheZone;

public:
	SquareZoneStatistic(): friendPlayerInTheZone(0), enemyPlayerInTheZone(0), ballInTheZone(0) {}

	/// Serialization of the class
	virtual void SerializeYourself(std::ofstream &fs);

	///  Deserialization of the class
	virtual void DeserialileYourself(std::ifstream &fs);

	unsigned int GetFriendPlayerInTheZone() const { return friendPlayerInTheZone; }
	unsigned int GetEnemyPlayerInTheZone() const { return enemyPlayerInTheZone; }
	unsigned int GetBallInTheZone() const { return ballInTheZone; }
	unsigned int GetInTheZone(StatisticsType type) const;
	void Reset();

	void IncFriendPlayerInTheZone() { friendPlayerInTheZone++; }
	void IncEnemyPlayerInTheZone() { enemyPlayerInTheZone++; }
	void IncBallInTheZone() { ballInTheZone++; }
};

#endif // SQUARE_ZONE_STATISTIC_H

