Skip to content

Commit 2b3c207

Browse files
committed
Finished Commenting the code
1 parent 799bd0b commit 2b3c207

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

src/GameBoard.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,6 @@ int GameBoard::FindLongestRoad(Player & owner){
307307
Coordinate start = roadVector->first;
308308
int temp_longest_path = FindLongestRoad_FromPoint(start, owner, marked, 0);
309309

310-
std::cout << "LONGEST PATH: " << start.first << ", " << start.second << ": " << temp_longest_path << "\n";
311-
312310
//if that path is longer than the current longest, set to the longest
313311
if (temp_longest_path > longest_path)
314312
longest_path = temp_longest_path;
@@ -319,9 +317,6 @@ int GameBoard::FindLongestRoad(Player & owner){
319317

320318

321319
int GameBoard::FindLongestRoad_FromPoint(Coordinate curr, Player & owner, std::map<Coordinate, bool>& marked, int length){
322-
323-
std::cout << " " << curr.first << ", " << curr.second << ": " << length << "\n";
324-
325320
marked[curr] = true;
326321
int longest_path = length;
327322
//traverse all the surrounding edges and vertices

src/Road.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,55 @@ Road::~Road() {
3535

3636
}
3737

38+
/**
39+
* Returns the starting coordinate of the road
40+
*/
3841
Coordinate Road::getStart() const{
3942
return start;
4043
}
44+
45+
/**
46+
* Returns the ending coordinate of the road
47+
*/
4148
Coordinate Road::getEnd() const{
4249
return end;
4350
}
4451

52+
/**
53+
* Returns true if the roads have the same coordinates whether they are matching starting or ending coordinates doesn't matter
54+
*/
4555
bool Road::equals(const Road& otherRoad){
4656
Coordinate otherstart = otherRoad.getStart();
4757
Coordinate otherend = otherRoad.getEnd();
4858
return equals(otherstart, otherend);
4959
}
5060

61+
/**
62+
* Returns true if the roads have the same coordinates whether they are matching starting or ending coordinates doesn't matter
63+
*/
5164
bool Road::equals(const Coordinate& otherStart, const Coordinate& otherEnd){
5265
if((otherStart == start && otherEnd == end) || (otherStart == end && otherEnd == start))
5366
return true;
5467
return false;
5568
}
5669

57-
58-
70+
/**
71+
* Returns true if the road is marked, false otherwise
72+
*/
5973
bool Road::isMarked(){
6074
return marker;
6175
}
6276

77+
/**
78+
* Marks the road
79+
*/
6380
void Road::mark(){
6481
marker = true;
6582
}
6683

84+
/**
85+
* Unmarks the road
86+
*/
6787
void Road::unmark(){
6888
marker = false;
6989
}

0 commit comments

Comments
 (0)