-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.h
More file actions
87 lines (71 loc) · 1.35 KB
/
Point.h
File metadata and controls
87 lines (71 loc) · 1.35 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef EX1_POINT_H
#define EX1_POINT_H
#include "Node.h"
/**
* class for Point, a kind of Node.
* containing values of x and y, for positioning on 2D grid.
*/
class Point: public Node {
private:
int _x;
int _y;
public:
/**
* constructor for Point.
*/
Point();
/**
* constructor for Point.
* @param x int
* @param y int
*/
Point(int x, int y);
/**
* constructor for Point.
* @param p const Point*
*/
Point(const Point* p);
/**
* getting x value.
* @return int
*/
int getX() const;
/**
* setting x value.
* @param x int
*/
void setX(int x);
/**
* getting the y value.
* @return int
*/
int getY() const;
/**
* setting the y value.
* @param y int
*/
void setY(int y);
/**
* return true if the nodes are equal.
* @param p Node*
* @return bool
*/
inline bool operator==(Node* p) const;
/**
* return true if the nodes are not equal.
* @param p
* @return
*/
inline bool operator!=(Node* p) const;
inline Node* operator+(Node* p) const;
/**
* function to print nodes.
* @param output ostream&
*/
void printNode(ostream& output) const;
/**
* distructor for Point.
*/
virtual ~Point(){};
};
#endif //EX1_POINT_H