48 lines
724 B
C++
Executable file
48 lines
724 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;
|
|
}
|
|
|
|
Ball_Tracker(uint32 trackerId)
|
|
{
|
|
this->parent = NULL;
|
|
this->moduleId = trackerId;
|
|
this->direction = EMPTY_FLOAT;
|
|
this->ballHeldCounter = 0;
|
|
}
|
|
|
|
protected:
|
|
float direction;
|
|
uint8 ballHeldCounter;
|
|
|
|
public:
|
|
void Update();
|
|
|
|
float GetBallDirection()
|
|
{
|
|
return direction;
|
|
}
|
|
|
|
bool KnowsBallDirection()
|
|
{
|
|
return (direction != EMPTY_FLOAT);
|
|
}
|
|
|
|
bool HasBall()
|
|
{
|
|
return (ballHeldCounter >= 3);
|
|
}
|
|
};
|
|
|
|
#endif
|