summaryrefslogtreecommitdiff
path: root/src/point.cpp
blob: 4b89a4a61fe8f9e87c61933fa6f4ad8456bdc969 (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
#include "point.h"
#include "velocity.h"

Point :: Point() {
    setX(0.0f);
    setY(0.0f);
}

Point :: Point (const float x, const float y) {
    setX(x);
    setY(y);
}

void Point :: setX(const float x) {
    this->x = x;
}

void Point :: setY(const float y) {
    this->y = y;
}

float Point :: getX() {
    return this->x;
}

float Point :: getY() {
    return this->y;
}

void Point :: update(Velocity &vel) {
    this->x += vel.getDx();
    this->y += vel.getDy();
}