-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameObject.h
executable file
·74 lines (68 loc) · 1.1 KB
/
GameObject.h
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* GameObject.h
*
* Created on: 22 apr 2018
* Author: rodolfo
*
* Definisce un ogetto di gioco generico
*/
#ifndef GAMEOBJECT_H_
#define GAMEOBJECT_H_
class GameObject {
protected:
/*
* Parametri dell' oggetto
*/
float width, height, x, y;
public:
/*
* Costruttore di default
*/
GameObject() :
width(0),
height(0),
x(0),
y(0) {
}
/*
* Costruttore Parametrizzato
* @param width dell' oggetto
* @param height dell' oggetto
* @param x dell' oggetto
* @param y dell' oggetto
*/
GameObject(float width, float height, float x, float y) :
width(width),
height(height),
x(x),
y(y) {
}
/*
* Setter e Getter
*/
inline float getHeight() const {
return height;
}
inline void setHeight(float height) {
this->height = height;
}
inline float getWidth() const {
return width;
}
inline void setWidth(float width) {
this->width = width;
}
inline float getX() const {
return x;
}
inline void setX(float x) {
this->x = x;
}
inline float getY() const {
return y;
}
inline void setY(float y) {
this->y = y;
}
};
#endif /* GAMEOBJECT_H_ */