-
Notifications
You must be signed in to change notification settings - Fork 0
/
eventLib.h
executable file
·51 lines (41 loc) · 1.36 KB
/
eventLib.h
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
//THIS FILE WILL BE REPLACED
/*
* =========================================================================================
* Name : eventLib.h
* Author : Duc Dung Nguyen, Nguyen Hoang Minh
* Email : [email protected]
* 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
* =========================================================================================
*/
#ifndef A01_EVENTLIB_H
#define A01_EVENTLIB_H
#include <iostream>
#include <fstream>
#include <string>
#include <string.h>
#include <sstream>
#include "listLib.h"
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#define EVENT_CODE_SIZE 20
using namespace std;
typedef struct ninjaEvent {
char code[EVENT_CODE_SIZE];
ninjaEvent() {
strcpy(code, "0");// default event is "0"
}
ninjaEvent(char* str) {
strncpy(code, str, EVENT_CODE_SIZE - 1);
}
ninjaEvent(string& str) {
strncpy(code, str.data(), EVENT_CODE_SIZE - 1);
}
ninjaEvent(ninjaEvent& a) { // copy constructor
memcpy(code, a.code, EVENT_CODE_SIZE);
}
} ninjaEvent_t;
void loadEvents(char* fName, L1List<ninjaEvent_t> &eList);
#endif //A01_EVENTLIB_H