1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00
Beef/BeefySysLib/util/Point.h

37 lines
427 B
C
Raw Normal View History

2019-08-23 11:56:54 -07:00
#pragma once
#include "Common.h"
NS_BF_BEGIN;
template <typename T>
class Point
2019-08-23 11:56:54 -07:00
{
public:
T x;
T y;
2019-08-23 11:56:54 -07:00
public:
Point(T x = 0, T y = 0)
2019-08-23 11:56:54 -07: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
}
};
typedef Point<double> PointD;
typedef Point<float> PointF;
typedef Point<int32> PointI32;
2019-08-23 11:56:54 -07:00
NS_BF_END;