/**
 * \file Player.h
 * \date 12.04.2003
 *
 * Interface for the Player object class
 */

#ifndef COMMON_WORLD_PLAYER_H
#define COMMON_WORLD_PLAYER_H

#include "Player/World/Movable.h"
#include "Common/World/Point.h"
#include "Common/World/Vector.h"
#include "Common/World/Types.h"
#include "Common/World/ParamStructs.h"
#include <stdlib.h>

/**
 * \class Player
 * \author Matus Horvath
 * \brief World object class representing a player
 */
class Player : public Movable
{
public:
	Player(World* w);
	Player(const Player&);
	virtual Player& operator=(const Player&);
	virtual ~Player();

	virtual Side GetSide() const { return side; }
	int GetUniform() const { return uniform; }
	bool IsGoalie() const { return goalie; }
	Angle GetAbsDir() const { return absDir; }
	Angle GetNeckDir() const { return neckDir; }
	bool IsDirValid() const { return dirValid; }
	Angle GetArmDir() const { return armDir; }
	bool IsArmValid() const { return armValid; }

	virtual void SetSide(Side s);
	void SetUniform(int u);
	void SetType(int i);
	void SetGoalie(bool g = true) { goalie = g; }
	void SetAbsDir(Angle d) { absDir = d; vel.SetAngle(d); }
	void SetNeckDir(Angle d) { neckDir = d; }
	void SetDirValid(bool v = true) { dirValid = true; }
	void SetArmDir(Angle d) { armDir = d; }
	void SetArmValid(bool v = true) { armValid = true; }
	
// Internal operations
	// Predict player state in next step
	void Step();

// Player type pointer
	PLAYER_TYPE* type;

protected:
	Side side;
	int uniform;	///< 0 -> unknown number
	bool goalie;

	Angle absDir;
	Angle neckDir;
	bool dirValid;
	Angle armDir;
	bool armValid;

};

#include "Player/World/World.h"

#endif // COMMON_WORLD_PLAYER_H
