-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblems.cpp
More file actions
36 lines (23 loc) · 853 Bytes
/
Copy pathproblems.cpp
File metadata and controls
36 lines (23 loc) · 853 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
#include "problems.h"
#include<iostream>
#include<vector>
using namespace std;
vector<Problem> problems;
vector<Problem> findErrors(vector<Situation> story, string shortFileName) {
vector<Problem> foundErrors = {};
vector<int> usedSitNums = {};
// First we check story/file-wide
if (story.empty()) { foundErrors.push_back({ SEV_EMPTY, FileSource({0, shortFileName})}); } // Empty story
for (Situation sit : story) {
// per sit
usedSitNums.push_back(sit.situationNum);
if (sit.options.empty()) { foundErrors.push_back(Problem(SEV_NOOPT, SituationSource{sit.situationNum})); } // SEV_NOOPT
for (size_t i = 0; i < sit.options.size(); i++) {
// per opt sit.options[i]
}
}
return foundErrors;
}
void problemFound(problemType problemType, ProblemSource problemsSource) {
problems.push_back({problemType, problemSource});
}