-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheventLib.cpp
More file actions
executable file
·28 lines (25 loc) · 980 Bytes
/
eventLib.cpp
File metadata and controls
executable file
·28 lines (25 loc) · 980 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
/*
* =========================================================================================
* Name : eventLib.cpp
* Author : Duc Dung Nguyen, Nguyen Hoang Minh
* Email : nddung@hcmut.edu.vn
* Copyright : Faculty of Computer Science and Engineering - Bach Khoa University
* Description : library for Assignment 1 - Data structures and Algorithms - Fall 2017
* This library contains functions used for event management
* =========================================================================================
*/
#include "eventLib.h"
/// NOTE: each event will be separated by spaces, or endline character
void loadEvents(char* fName, L1List<ninjaEvent_t> &eList) {
string str, temp;
fstream filein(fName, ios::in | ios::out);
getline(filein, temp, ';');
stringstream sstemp(temp);
while (getline(sstemp, str))
{
stringstream ss(str);
ninjaEvent_t nje;
while (ss >> nje.code) eList.push_back(nje);
}
filein.close();
}