/**
 * \file Synchronization.h
 * \date 09.03.2002
 *
 * Interface for the SynchronizationInterface class
 */

#ifndef PLAYER_INTERFACES_SYNCHRONIZATION_H
#define PLAYER_INTERFACES_SYNCHRONIZATION_H

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


/// Synchronization modes
enum SynchroMode
{
	Synch_Normal,				///< after SB
	Synch_WaitForVI,			///< after VI (searching for ball)
	Synch_VIOnly				///< only after VI
};


/**
 * \class SynchronizationInterface
 * \author Marek Lehuta
 * \brief Synchronization task interface
 *
 * Synchronization task decides when an action should be taken
 */
class SynchronizationInterface : public Interface
{
public:
	// Construction and destruction
	SynchronizationInterface()
		: Interface("Synchronization interface", "v0.0.02") {}
	virtual ~SynchronizationInterface() {}


	// Interface functions

	/// The following functions are called after receiving a message
	//@{
//	virtual int OnSendMsg(int, void*) = 0;
//	virtual int OnReceiveMsg(int, void*) = 0;

	/// Handler for first message after connecting to server
	virtual void OnInit(RealSide realSide, int uniform, PlayMode mode) = 0;

	/// Handler for change mode message (referee message)
	virtual void OnChangeMode(int time, PlayMode mode) = 0;

	/// Handler for audio perception
	virtual void OnHear(int time, float direction, bool ourTeam, int uniform, const char* msg) = 0;

	/// Handler for score information message
	virtual void OnScore(int time, int our, int their) = 0;

	/// Handler for sense_body message
	virtual void OnSenseBody(const SENSE_BODY*) = 0;

	/// Handler for see message
	virtual void OnSee(const VISUAL_INFO*) = 0;

	/// Handler for player type change
	virtual void OnChangePlayerType(int uniform, int iType) = 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;
	//@}
	
    // GP
    /// Handler for freeform messages 
    virtual void OnFreeform(const char* msg) = 0;
    /// Handler for useNeuralNetwork clang message 
//	virtual void OnSetParameterUseNN(const char* msg) = 0;

	/// The following functions are called after sending a message
	//@{
	virtual void OnExecKick(float fPower, float fDirection) = 0;
	virtual void OnExecTurn(float fMoment) = 0;
	virtual void OnExecDash(float fPower) = 0;
	virtual void OnExecNeck(int iAngle) = 0;
	//@}

	
	/// Set synchronization mode
	virtual void SetNextSynchMode(SynchroMode next) = 0;
	/// Find out next synchronization mode
	virtual SynchroMode GetNextSynchMode() const = 0;
	/// Find out current synchronization mode
	virtual SynchroMode GetCurrentSynchMode() const = 0;

	virtual void OnGoal(bool p_WeGaveTheGoal) = 0;

protected:

private:

};

#endif // INTERFACES_SYNCHRONIZATION_H
