Files
vba10/Rectangle.h

43 lines
744 B
C++

#ifndef RECTANGLE_H_
#define RECTANGLE_H_
#include "Point.h"
#include "Size.h"
namespace Engine
{
struct Rectangle
{
public:
//union
//{
// struct
// {
int X;
int Y;
unsigned int Width;
unsigned int Height;
//};
//struct
//{
Point TopLeft;
Size Size;
// };
//};
Rectangle();
Rectangle(int x, int y, unsigned int width, unsigned int height);
Rectangle(const Point &topleft, const Engine::Size &size);
~Rectangle() = default;
Point GetBottomRight(void) const;
void GetBottomRight(Point *p) const;
void SetBottomRight(Point p);
bool Contains(const Rectangle &other) const;
bool Intersects(const Rectangle &other) const;
};
}
#endif