-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClasses.cs
More file actions
185 lines (158 loc) · 4.16 KB
/
Classes.cs
File metadata and controls
185 lines (158 loc) · 4.16 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
namespace KarooLiveTracking
{
public class ActivityInfo
{
public string? key { get; set; }
public Value? value { get; set; }
}
public class Elevation
{
public double? gain { get; set; }
public double? loss { get; set; }
public double? max { get; set; }
public double? min { get; set; }
public string? polyline { get; set; }
public string? source { get; set; }
}
public class LiveTrack
{
public List<ActivityInfo>? activityInfo { get; set; }
public double? bearing { get; set; }
public DateTime? createdAt { get; set; }
public double EastBound
{
get
{
if (locations == null)
{
return 0.0;
}
return locations.Max(r => r.lng);
}
}
public string? id { get; set; }
public Location? location { get; set; }
public List<Location>? locations { get; set; }
public double NorthBound
{
get
{
if (locations == null)
{
return 0.0;
}
return locations.Max(r => r.lat);
}
}
public string? riderName { get; set; }
public Route? route { get; set; }
public double SouthBound
{
get
{
if (locations == null)
{
return 0.0;
}
return locations.Min(r => r.lat);
}
}
public string? state { get; set; }
public DateTime? updatedAt { get; set; }
public double WestBound
{
get
{
if (locations == null)
{
return 0.0;
}
return locations.Min(r => r.lng);
}
}
}
public class Location
{
public double lat { get; set; }
public double lng { get; set; }
}
public class PointsOfInterest
{
public string? description { get; set; }
public Location? location { get; set; }
public string? name { get; set; }
public string? type { get; set; }
}
public class Route
{
public double? distance { get; set; }
public double EastBound
{
get
{
if (route == null)
{
return 0.0;
}
return route.Max(r => r.lng);
}
}
public Elevation? elevation { get; set; }
public string? name { get; set; }
public double NorthBound
{
get
{
if (route == null)
{
return 0.0;
}
return route.Max(r => r.lat);
}
}
public List<PointsOfInterest>? pointsOfInterest { get; set; }
public int PointsOfInterestHash
{
get
{
var txt = String.Join("", pointsOfInterest.Select(r => r.name + r.description + r.location.lat + r.location.lng));
return txt.GetHashCode();
}
}
public List<Location>? route { get; set; }
public string? routePolyline { get; set; }
public double SouthBound
{
get
{
if (route == null)
{
return 0.0;
}
return route.Min(r => r.lat);
}
}
public List<Waypoint>? waypoints { get; set; }
public double WestBound
{
get
{
if (route == null)
{
return 0.0;
}
return route.Min(r => r.lng);
}
}
}
public class Value
{
public string? format { get; set; }
public double? value { get; set; }
}
public class Waypoint
{
public double? lat { get; set; }
public double? lng { get; set; }
}
}