Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Timer by
Diff: Map/Point.h
- Revision:
- 47:be4eebf40568
- Parent:
- 45:b53ae54062c6
- Child:
- 49:5e2f7323f280
--- a/Map/Point.h Wed Apr 13 12:47:47 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#ifndef POINT_H
-#define POINT_H
-
-#include <vector>
-
-class Point;
-
-class Point
-{
- public:
- Point()
- {
- x=y=G=H=0;
- }
-
- Point(int x, int y, float G=0, float H=0) : x(x),y(y),G(G),H(H)
- {
-
- }
-
- virtual ~Point()
- {
-
- }
-
- Point operator=(const Point &acase)
- {
- x=acase.x;
- y=acase.y;
- G=acase.G;
- H=acase.H;
- p=acase.p;
- return *this;
- }
-
- void setx(int xx) { x=xx; }
- void sety(int yy) { y=yy; }
- void setG(float GG) { G=GG; }
- void setH(float HH) { H=HH; }
- void setParent(Point *pp) { p=pp; }
- void setParent() { p=0; }
-
- int getx() { return x; }
- int gety() { return y; }
- float getF() { return G+H; }
- float getG() { return G; }
- float getH() { return H; }
- Point* getParent() { return p; }
-
-
- bool in(std::vector<Point*> &list, unsigned int &pos)
- {
- for(unsigned int i=0;i<list.size();i++)
- if(list[i]->getx() == this->getx() && list[i]->gety() == this->gety())
- {
- pos = i;
- return true;
- }
- return false;
- }
-
- bool in(std::vector<Point*> &list)
- {
- for(unsigned int i=0;i<list.size();i++)
- if(list[i]->getx() == this->getx() && list[i]->gety() == this->gety())
- return true;
- return false;
- }
-
- private:
- int x;
- int y;
- float G;
- float H;
- Point *p;
-};
-
-#endif // POINT_H
