-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoint.h
33 lines (29 loc) · 974 Bytes
/
Point.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Benjy Berkowicz - 336182589
// Advanced Programming 2016-2017 Bar Ilan
//
#ifndef ADVANCED_EX2_POINT_H
#define ADVANCED_EX2_POINT_H
#include <iostream>
#include <sstream>
/**
* The Point class is a container holding x and y integer members.
* In order to make the GridMap and BfsAlgorithm work with more parameters, the point class would
* need to be inherited and abstractded (used as an Interface), in particular, it would need to
* hold more than just x and y parameters (it would need as many dimensions as required).
*/
class Point {
public:
int x;
int y;
// Initializes the point to a given x and y values.
Point(int setX, int setY);
// Initializes the point to a default -1,-1
Point();
// Converts the point into a string form (readability)
virtual std::string toString();
// Compares two points with one another
virtual bool operator==(Point &other);
int distanceTo(Point);
};
#endif //ADVANCED_EX2_POINT_H