summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/robot.h
blob: 13aa69687bb311f76046347454213362820a5322 (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
#ifndef _ROBOT_H
#define _ROBOT_H

#include "stdafx.h"

class IO_Module;
class Sensor;
class Engine;

class Robot
{
public:
	Robot();
	~Robot();

private:
	IO_Module* modules[IO_END];

public:
	bool AddModule(IO_Module* newModule);

	template <class T> T* GetModule(uint8 moduleId)
	{
		return ((T*)modules[moduleId]);
	}

	bool RemoveModule(uint8 moduleId)
	{
		if(!modules[moduleId])
			return false;

		delete modules[moduleId];
		modules[moduleId] = NULL;

		return true;
	}

	bool RemoveModule(IO_Module* oldModule);

	void Update();

	uint16 GetADCValue(uint8 channel);
};

#endif