/**
 * Create a course based on the selected event
 */
void EventCreator::CreateCourse() {
    using namespace std;
    int eventIndex = ChooseEvent();
    int node;
    vector<int> courseNodes;
    vector<int> allowedNodes;
    if(eventIndex >= 0) {
        Event event = events[eventIndex];
        allowedNodes = event.GetNodes();
        
        if(event.GetCourses().size() <= 26) {
            cout << "Enter nodes for course. Enter 0 to finish: " << endl;

            do {
                node = scanner.ReadInt();
                if(find(allowedNodes.begin(), allowedNodes.end(), node)!=allowedNodes.end()) {
                    courseNodes.push_back(node);
                } else if (node != 0) {
                    cout << "Not a valid node number!" << endl;
                }
            } while(node != 0);
            
            //convert numerical index to character index
            // e.g. ASCII 'A' is 65, 'B' is 66 etc.
            char id = (int)event.GetCourses().size()+65;

            event.AddCourse(id, courseNodes);
            events[eventIndex] = event;

        } else {
            cout << "Events can not have more than 26 courses" << endl;
        }
    }
}