Working on preliminary version of ActionEngine

This commit is contained in:
2024-07-02 21:32:37 -04:00
parent 37cdd714a9
commit 126cc58c67
4 changed files with 86 additions and 1 deletions

33
include/Point2D.h Normal file
View 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