/**
 * \file CoachSynchronization.h
 * \date 14.12.2002
 *
 * Interface for the CoachSynchronizationInterface class
 */

#ifndef INTERFACES_COACH_SYNCHRONIZATION_H
#define INTERFACES_COACH_SYNCHRONIZATION_H

#include "Common/Interfaces/Interface.h"
#include "Common/Protocol/ParseStructs.h"

/**
 * \class CoachSynchronizationInterface
 * \author Peter Trebaticky
 * \brief Synchronization task interface
 *
 * Synchronization task decides when an action should be taken
 */

class CoachSynchronizationInterface : public Interface
{
public:
	// Construction and destruction
	CoachSynchronizationInterface()
		: Interface("Coach synchronization interface", "v0.0.1") {}
	virtual ~CoachSynchronizationInterface() {}

	// Interface functions

	/// The following functions are called after receiving a message
	//@{

	/// Handler for first message after connecting to server
	/// \param side true: left, false: right
	virtual void OnInit(bool side) = 0;

	/// Handler for change mode message (referee message)
	/// \param time in which cycle was play mode changed
	/// \param mode what play mode is now actual
	virtual void OnChangeMode(int time, PlayMode mode) = 0;

	/// Handler for audio perception
	/// \param time in which cycle was message spoken
	/// \param our if spoke our player (true) or their player (false)
	/// \param uniformNumber
	/// \param message
	virtual void OnHear(int time, bool our, int uniformNumber, const char* message) = 0;

	/// Handler for score information message
	/// \param time in which cycle was this message sent
	/// \param our our score
	/// \param their their score
	virtual void OnScore(int time, unsigned int our, unsigned int their) = 0;

	/// Handler for see_global message
	/// \param vi information about players and ball
	virtual void OnSeeGlobal(const COACH_VISUAL_INFO* vi) = 0;

	/// Handler for player type change
	/// \param number which player has been changed
	/// \param type what type is now
	virtual void OnChangePlayerType(unsigned number, int type) = 0;

	/// Handler for server parameters change
	virtual void OnServerParam(const SERVER_PARAMS* params) = 0;

	/// Handler for information about hetero player types
	virtual void OnPlayerParam(const PLAYER_PARAMS* params) = 0;

	/// Handler for information about one hetero (or normal) player type
	virtual void OnPlayerType(int id, const PLAYER_TYPE* type) = 0;

	/// Handler for 'ok team_graphic' messages
	virtual void OnOkTeamGraphic(int x, int y) = 0;
	//@}
	
protected:

private:

};

#endif // INTERFACES_COACH_SYNCHRONIZATION_H
