aboutsummaryrefslogtreecommitdiff
path: root/cObject.h
blob: 607af4e03395acf147396da76d5821b210d4e5e9 (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
#pragma once
#include <stdlib.h>

#include "cRender.h"

struct sObject

{
	sPos pos;
	WORD **wColor;
	char **cScreen;
	int sizeX;
	int sizeY;
};

class cObject : public cRender
{
public:
	cObject(int _sx, int _sy);
	//_sx : SizeX
	//_sy : SizeY

	virtual ~cObject();

	sPos getPosition();

	void setPosition(sPos _pos);

	void setPosition(int _x, int _y);

	sObject getObject();

	virtual void onClick(sPos _pos, unsigned int _button){};

	virtual void onChar(unsigned char _c){};

protected: //For child classes
	cObject();

	void setSize(int _sx, int _sy);

	void destruct();

private:
	//wColor, cScreen, sizeX and sizeY are inherited from cRender
	sPos pos;
	bool bSizeSet;
};