2019-08-23 11:56:54 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Common.h"
|
|
|
|
|
|
|
|
NS_BF_BEGIN;
|
|
|
|
|
2025-03-28 08:08:33 -04:00
|
|
|
template <typename T>
|
|
|
|
class Point
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
|
|
|
public:
|
2025-03-28 08:08:33 -04:00
|
|
|
T x;
|
|
|
|
T y;
|
2019-08-23 11:56:54 -07:00
|
|
|
|
|
|
|
public:
|
2025-03-28 08:08:33 -04:00
|
|
|
Point(T x = 0, T y = 0)
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
2025-03-28 08:08:33 -04:00
|
|
|
this->x = x;
|
|
|
|
this->y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
Point operator+(Point rhs)
|
|
|
|
{
|
|
|
|
return Point(x + rhs.x, y + rhs.y);
|
|
|
|
}
|
|
|
|
|
|
|
|
Point operator-(Point rhs)
|
|
|
|
{
|
|
|
|
return Point(x - rhs.x, y - rhs.y);
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2025-03-28 08:08:33 -04:00
|
|
|
typedef Point<double> PointD;
|
|
|
|
typedef Point<float> PointF;
|
|
|
|
typedef Point<int32> PointI32;
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
NS_BF_END;
|