summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/logic/logic.h
blob: 296956bc6643a5842c883f4f11b6f1421a13e1cb (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
52
53
54
55
56
57
58
#ifndef _LOGIC_H
#define _LOGIC_H

#include "../../stdafx.h"

#define STATUS_KEEPER_TURN_RIGHT 1
#define STATUS_KEEPER_TURN_LEFT 2

class Logic : public IO_Module
{
public:
	Logic()
	{
		this->parent = NULL;
		this->moduleId = 0;
		this->isKeeper = false;
		this->status = 0;
	}

	Logic(uint32 logicId)
	{
		this->parent = NULL;
		this->moduleId = logicId;
		this->isKeeper = false;
		this->status = 0;
	}

protected:
	bool isKeeper;
	uint8 status;

	void OnBallOwned();
	void OnBallLost();

public:
	void Update();

	bool IsKeeper()
	{
		return isKeeper;
	}

	bool IsAttacker()
	{
		return !isKeeper;
	}

	void SetKeeper(bool newStatus) {
		this->isKeeper = newStatus;
	}

	bool HasBall()
	{
		//fill me!
	}
};

#endif