raven/src/Point.hpp
hippoz 1aec5d3e44
☢️☢️☢️☢️☢️☢️
2022-04-30 09:40:09 +03:00

26 lines
No EOL
525 B
C++

#pragma once
namespace Raven {
class Point {
private:
double m_x;
double m_y;
public:
Point(double x, double y)
: m_x(x)
, m_y(y) {}
double x() { return m_x; }
const double x() const { return m_x; }
double y() { return m_y; }
const double y() const { return m_y; }
void set_x(double x) { m_x = x; }
void set_y(double y) { m_y = y; }
void add(double x, double y) { m_x += x; m_y += y; }
void add(Point const& other) { m_x += other.x(); m_y += other.y(); }
};
}