This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/Concept/Framework/modules/interpreter/ball_tracker.h
2007-02-22 20:59:02 +00:00

51 lines
786 B
C++
Executable file

#ifndef _BALL_TRACKER_H
#define _BALL_TRACKER_H
#include "../../stdafx.h"
class Ball_Tracker : public IO_Module
{
public:
Ball_Tracker()
{
this->parent = NULL;
this->moduleId = 0;
this->direction = EMPTY_FLOAT;
this->ballHeldCounter = 0;
this->ballHeld = false;
}
Ball_Tracker(uint32 trackerId)
{
this->parent = NULL;
this->moduleId = trackerId;
this->direction = EMPTY_FLOAT;
this->ballHeldCounter = 0;
this->ballHeld = false;
}
protected:
float direction;
uint8 ballHeldCounter;
bool ballHeld;
public:
void Update();
float GetBallDirection()
{
return direction;
}
bool KnowsBallDirection()
{
return (direction != EMPTY_FLOAT);
}
bool RobotHasBall()
{
return ballHeld;
}
};
#endif