summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/interpreter/ball_tracker.h
blob: cb90ff2e6c1d9e2902ad6db12c8aaa6d0380388a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#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