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

#ifndef COMMON_WORLD_BALL_H
#define COMMON_WORLD_BALL_H

#include "Player/World/Movable.h"
#include "Common/World/Point.h"
#include "Common/World/Vector.h"
#include "Common/Protocol/ParseStructs.h"

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

	bool IsValid() const { return valid; }
	void SetValid(bool v = true) { valid = v; }

	// Calculate ball position, speed, ...
	void Recalculate(const SENSE_BODY* sb, const VISUAL_INFO* vi);
	
	// Predict this ball state in next step
	void Step();
	
private:
	bool valid;

	// Last position and time, when we have actually seen the ball
	Point lastSeenPos;
	int lastSeenTime;

};

#endif // COMMON_WORLD_BALL_H
