Working on preliminary version of ActionEngine
This commit is contained in:
33
include/Point2D.h
Normal file
33
include/Point2D.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef POINT2D_H
|
||||
#define POINT2D_H
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
class Point2D {
|
||||
public:
|
||||
Point2D() : x(0), y(0) {}
|
||||
Point2D(uint16_t _x, uint16_t _y) : x(_x), y(_y) {}
|
||||
|
||||
virtual ~Point2D() {}
|
||||
|
||||
void setX(uint16_t _x) { x = _x; }
|
||||
void setY(uint16_t _y) { y = _y; }
|
||||
uint16_t getX() { return x; }
|
||||
uint16_t getY() { return y; }
|
||||
bool isOrigin() { return x == 0 && y == 0; }
|
||||
|
||||
bool operator==(const Point2D& other) {
|
||||
return this->x == other.x && this->y == other.y;
|
||||
}
|
||||
|
||||
bool operator!=(const Point2D other) {
|
||||
return this->x != other.x || this->y != other.y;
|
||||
}
|
||||
|
||||
private:
|
||||
uint16_t
|
||||
x,
|
||||
y;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user