-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.h
81 lines (68 loc) · 4.67 KB
/
node.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
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
#ifndef _NODE_HEADER
#define _NODE_HEADER
#include "point.h"
#include "plotter.h"
class Node
{
private:
Point location;
char symbol;
public:
//***********************************************************************************
//description: creates a new Node at the specified point symbol = square *
//returns: nothing *
//pre: none *
//post: a new Node is created *
//***********************************************************************************
Node(Point);
//*********************************************************************************
//description: Constructs a default Node with a default Point and symbol = square *
//returns: none *
//pre: none *
//post: a new Node is constructed with the above default characteristics *
//*********************************************************************************
Node();
//*********************************************************************************
//description: gets Location *
//returns: Point *
//pre: Location exists and is a Point *
//post: Location remains unchanged *
//*********************************************************************************
Point getLocation();
//*********************************************************************************
//description: gets Symbol *
//returns: char *
//pre: Symbol exists and is a char *
//post: Symbol remains unchanged *
//*********************************************************************************
char getSymbol();
//*********************************************************************************
//description: sets Location to the value of the Point *
//returns: void *
//pre: Location exists and is a Point *
//post: the value of the Point is stored in Location *
//*********************************************************************************
void setLocation(Point);
//*********************************************************************************
//description: sets Symbol to the value of the char *
//returns: void *
//pre: Symbol exists and is a char *
//post: the value of the char is stored in Symbol *
//*********************************************************************************
void setSymbol(char);
//*********************************************************************************
//description: tests if two Nodes are identical *
//returns: bool *
//pre: both Nodes exist *
//post: returns true if the Nodes are identical, false if they aren't *
//*********************************************************************************
bool equals(Node);
//*********************************************************************************
//description: prints symbol at the locatioin stored in Point *
//returns: void *
//pre: a Plotter is declared *
//post: the character in symbol is printed at the Point in the Node *
//*********************************************************************************
void draw(Plotter);
};
#endif