-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActorNode.cpp
More file actions
58 lines (45 loc) · 875 Bytes
/
Copy pathActorNode.cpp
File metadata and controls
58 lines (45 loc) · 875 Bytes
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
/*
* ActorNode.cpp
* Author: <Edrees Noorzay>
* Date: <06/03/16>
*
* This is the file for the class representing the node, containing
* its data, and the functions to access it.
*/
#include "ActorNode.hpp"
using namespace std;
ActorNode::ActorNode(void) {
}
ActorNode::ActorNode(string n)
{
name = n;
dist = 999; // initialized for BFS and djik
done = false;
earliestfilm = 9999;
}
// access name
string ActorNode::getName()
{
return name;
}
// add new edge to vector
void ActorNode::addEdge(ActorEdge * edge)
{
edges.push_back(edge);
}
// add new movie to vector
void ActorNode::addMovie(string mov)
{
movies.push_back(mov);
}
// returns formatted output of all movies cast in
string ActorNode::listMovies()
{
string list = movies[0];
for (int i = 1; i < movies.size(); i++)
{
list += ", \t" + movies[i];
}
list += "\n";
return list;
}