raven/src/Box.hpp

37 lines
761 B
C++
Raw Normal View History

2022-03-08 02:25:22 +02:00
#pragma once
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; }
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);
bool contains_box(const Box &other);
};
}