2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CVECTOR2I
|
|
|
|
#define _CVECTOR2I
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
class CVector2i {
|
2022-10-02 10:13:35 +00:00
|
|
|
public:
|
|
|
|
CVector2i(int, int);
|
|
|
|
|
2022-10-04 20:11:34 +00:00
|
|
|
int GetX() const { return mX; }
|
|
|
|
int GetY() const { return mY; }
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-12-06 23:32:47 +00:00
|
|
|
int& operator[](int idx) { return *(&mX + idx); }
|
|
|
|
const int& operator[](int idx) const { return *(&mX + idx); }
|
|
|
|
|
2022-08-13 02:48:34 +00:00
|
|
|
private:
|
2022-10-04 20:11:34 +00:00
|
|
|
int mX;
|
|
|
|
int mY;
|
2022-08-13 02:48:34 +00:00
|
|
|
};
|
|
|
|
|
2022-10-04 20:11:34 +00:00
|
|
|
CVector2i operator+(const CVector2i& lhs, const CVector2i& rhs);
|
|
|
|
CVector2i operator+(const CVector2i& lhs, const CVector2i& rhs);
|
|
|
|
bool operator==(const CVector2i& lhs, const CVector2i& rhs);
|
|
|
|
CVector2i operator*(const CVector2i& lhs, int rhs);
|
|
|
|
CVector2i operator/(const CVector2i& lhs, int rhs);
|
2022-10-09 05:13:17 +00:00
|
|
|
|
|
|
|
#endif // _CVECTOR2I
|