-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
54 lines (38 loc) · 899 Bytes
/
main.cpp
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
/*
* main.cpp
*
* Created on: 3/06/2017
* Author: jamie
*/
#include <iostream>
using namespace std;
#include "Graph/graph.h"
#include "StoryNode/storynode.h"
#include "Compiler/compiler.h"
int main() {
StoryNode s1 = StoryNode();
StoryNode s2 = StoryNode();
StoryNode s3 = StoryNode();
vector<StoryNode *> a1 = {&s2, &s3};
vector<StoryNode *> a2 = {&s1};
vector<StoryNode *> a3 = {&s1};
Graph<StoryNode> g;
g.addVertex(&s1, a1);
g.addVertex(&s2, a2);
g.addVertex(&s3, a3);
g.printGraph();
cout << g.isNeighbor(&s1, &s3) << endl;
vector<StoryNode *> n = g.getNeighbors(&s1);
for (auto x: n) {
cout << "Neighbor: " << x->getNodeId() << endl;
}
//g.removeVertex(&s1);
cout << "********" << endl;
g.printGraph();
if (g.isNeighbor(&s2, &s3)) {
cout << "These two are neighbors" << endl;
}
Lexer l("Compiler/commands.txt");
l.printFile();
return 0;
}