aboutsummaryrefslogtreecommitdiffstats
path: root/include/vec2.hpp
blob: 6b3c30ad510ba75c4cf31b8885af7b9dadb4c4db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef VEC2_HPP
#define VEC2_HPP

struct Vec2 {
    float x, y;

    auto operator+(const Vec2& o) const noexcept {
        return Vec2 {x + o.x, y + o.y};
    }

    auto& operator+=(const Vec2& o) noexcept {
        x += o.x;
        y += o.y;
        return *this;
    }
};

#endif // VEC2_HPP