-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrack.cpp
53 lines (44 loc) · 860 Bytes
/
Track.cpp
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
52
53
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include "json.hpp"
#include "Track.h"
using json = nlohmann::json;
namespace sdds {
void Track::setEmptyTrack() {
m_trackID = 0;
m_trackName = nullptr;
m_season = 0;
m_trackConditions = 0;
m_time = 0;
}
Track::Track() {
setEmptyTrack();
}
Track::Track(int id, int season, int conditions, int time) {
m_trackID = id;
m_trackName = new char[100]();
m_season = season;
m_trackConditions = conditions;
m_time = time;
}
Track::~Track() {
delete[] m_trackName;
m_trackName = nullptr;
}
int Track::getTrackID() {
return m_trackID;
}
char* Track::getTrackName() {
return m_trackName;
}
int Track::getSeason() {
return m_season;
}
int Track::getTrackConditions() {
return m_trackConditions;
}
int Track::getTime() {
return m_time;
}
}