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

49 lines
724 B
C
Raw Normal View History

2007-02-18 00:14:00 +00:00
#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;
2007-02-19 17:15:02 +00:00
this->direction = EMPTY_FLOAT;
2007-02-22 20:59:02 +00:00
this->ballHeldCounter = 0;
2007-02-18 00:14:00 +00:00
}
Ball_Tracker(uint32 trackerId)
{
this->parent = NULL;
this->moduleId = trackerId;
2007-02-19 17:15:02 +00:00
this->direction = EMPTY_FLOAT;
2007-02-22 20:59:02 +00:00
this->ballHeldCounter = 0;
2007-02-18 00:14:00 +00:00
}
protected:
float direction;
2007-02-22 20:59:02 +00:00
uint8 ballHeldCounter;
2007-02-18 00:14:00 +00:00
public:
void Update();
float GetBallDirection()
{
return direction;
}
2007-02-22 13:12:03 +00:00
bool KnowsBallDirection()
{
2007-02-22 20:59:02 +00:00
return (direction != EMPTY_FLOAT);
2007-02-22 13:12:03 +00:00
}
2007-02-26 21:25:01 +00:00
bool HasBall()
2007-02-22 13:12:03 +00:00
{
2007-02-26 21:25:01 +00:00
return (ballHeldCounter >= 3);
2007-02-22 13:12:03 +00:00
}
2007-02-18 00:14:00 +00:00
};
#endif