-
Notifications
You must be signed in to change notification settings - Fork 0
/
HighwayConnectionXml.h
65 lines (47 loc) · 1.16 KB
/
HighwayConnectionXml.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
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* File: HighwayConnectionXml.h
* Author: bdupont
*
* Created on September 19, 2011, 8:35 PM
*/
#ifndef _HIGHWAYCONNECTIONXML_H
#define _HIGHWAYCONNECTIONXML_H
#include "tinyxml.h"
using namespace std;
class HighwayConnectionXml {
private:
int m_highwayId;
int m_laneOffset;
int m_offset;
public:
int GetHighwayId() {
return m_highwayId;
}
void SetHighwayId(int highwayId) {
m_highwayId = highwayId;
}
int GetLaneOffset() {
return m_laneOffset;
}
void SetLaneOffset(int laneOffset) {
m_laneOffset = laneOffset;
}
int GetOffset() {
return m_offset;
}
void SetOffset(int offset) {
m_offset = offset;
}
void LoadFromXml(TiXmlHandle root) {
m_highwayId = -10000;
m_laneOffset = 0;
m_offset = 0;
TiXmlElement* rootPtr = root.Element();
if(rootPtr) {
rootPtr->QueryIntAttribute("highwayId", &m_highwayId);
rootPtr->QueryIntAttribute("laneOffset", &m_laneOffset);
rootPtr->QueryIntAttribute("offset", &m_offset);
}
}
};
#endif /* _HIGHWAYCONNECTIONXML_H */