aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/vector2.cpp
blob: 6dcd7d65b698a964b3a822fb40b25a54dc2923e5 (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
#include "vector2.hpp"

Vector2::Vector2(const Vector2Options &options) : _x(options.x), _y(options.y) {}

int32_t Vector2::get_x() const noexcept
{
	return _x;
}

void Vector2::set_x(int32_t x) noexcept
{
	_x = x;
}

int32_t Vector2::get_y() const noexcept
{
	return _y;
}

void Vector2::set_y(int32_t y) noexcept
{
	_y = y;
}

const Vector2 &Vector2::operator+=(const Vector2 &vector2) noexcept
{
	_x += vector2._x;
	_y += vector2._y;

	return *this;
}

const Vector2 &Vector2::operator-=(const Vector2 &vector2) noexcept
{
	_x -= vector2._x;
	_y -= vector2._y;

	return *this;
}