summaryrefslogtreecommitdiff
path: root/src/object.cpp
blob: 5f1fac7b598815f8fedb1219c6739c19d03aa955 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include "object.h"
#include "point.h"
#include "velocity.h"
#include "acceleration.h"

Object :: Object() {
    setAngle(0.0f);
    setWidth(0);
    setHeight(0);
    setPoint(Point());
    setVelocity(Velocity());
    setAcceleration(Acceleration());
    setAlive(true);
}

Object :: Object(const Point &point) {
    setAngle(0.0f);
    setWidth(0);
    setHeight(0);
    setPoint(point);
    setVelocity(Velocity());
    setAcceleration(Acceleration());
    setAlive(true);
}

Object :: Object(const Point &point, const Velocity &velocity) {
    setAngle(0.0f);
    setWidth(0);
    setHeight(0);
    setPoint(point);
    setVelocity(velocity);
    setAcceleration(Acceleration());
    setAlive(true);
}
Object :: Object(const Point &point, const Velocity &velocity, const Acceleration &acceleration) {
    setAngle(0.0f);
    setWidth(0);
    setHeight(0);
    setPoint(point);
    setVelocity(velocity);
    setAcceleration(acceleration);
    setAlive(true);
}

void Object :: setAngle(const float angle) {
    this->angle = angle;
}

void Object :: setWidth(const int width) {
    this->width = width;
}

void Object :: setHeight(const int height) {
    this->height = height;
}

void Object :: setPoint(const Point &point) {
    this->point = point;
}

void Object :: setVelocity(const Velocity &velocity) {
    this->velocity = velocity;
}

void Object :: setAcceleration(const Acceleration &acceleration) {
    this->acceleration = acceleration;
}

void Object :: setAlive(const bool alive) {
    this->alive = alive;
}

void Object :: setTexture(const sf::Texture &texture) {
    this->texture = texture;
}

void Object :: setSprite(const sf::Sprite &sprite) {
    this->sprite = sprite;
}

float Object :: getAngle() {
    return this->angle;
}

int Object :: getWidth() {
    return this->width;
}

int Object :: getHeight() {
    return this->height;
}

Point Object :: getPoint() {
    return this->point;
}

Velocity Object :: getVelocity() {
    return this->velocity;
}

Acceleration Object :: getAcceleration() {
    return this->acceleration;
}

bool Object :: getAlive() {
    return this->alive;
}

sf::Texture Object :: getTexture() {
    return this->texture;
}

sf::Sprite Object :: getSprite() {
    return this->sprite;
}

void Object :: kill() {
    setAlive(false);
}