raven/src/Box.hpp
2022-03-18 03:24:02 +02:00

44 lines
1 KiB
C++

#pragma once
#include "Point.hpp"
namespace Raven {
class Box {
private:
double m_x {0};
double m_y {0};
double m_width {0};
double m_height {0};
public:
Box() {}
Box(double x, double y, double width, double height)
: m_x(x)
, m_y(y)
, m_width(width)
, m_height(height)
{
}
double get_x() { return m_x; }
double get_y() { return m_y; }
double get_width() { return m_width; }
double get_height() { return m_height; }
double get_x() const { return m_x; }
double get_y() const { return m_y; }
double get_width() const { return m_width; }
double get_height() const { return m_height; }
void set_x(double x) { m_x = x; }
void set_y(double y) { m_y = y; }
void set_width(double width) { m_width = width; }
void set_height(double height) { m_height = height; }
bool contains_point(double x, double y) const;
bool contains_point(const Point &point) const;
bool contains_box(const Box &other) const;
};
}