-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRaces.cs
More file actions
121 lines (110 loc) · 3.77 KB
/
Races.cs
File metadata and controls
121 lines (110 loc) · 3.77 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace JSONAPI
{
/*
Filen inneholder bare klasser for informasjon som blir hentet
fra API og mapper ut strukturen til selve .json filen fra API.
Newtonsoft.json håndterer getting og setting av
disse automatisk når man deserializer.
*/
public class Races
{
int season;
string round;
string url;
string raceName;
string date;
string time;
public int Season { get => season; set => season = value; }
public string Round { get => round; set => round = value; }
public string Url { get => url; set => url = value; }
public string RaceName { get => raceName; set => raceName = value; }
public string Date { get => date; set => date = value; }
public string Time { get => time; set => time = value; }
public Circuit Circuit { get; set; }
public IList<Results> Results { get; set; }
}
public class Circuit
{
string circuitId;
string url;
string circuitName;
public string CircuitId { get => circuitId; set => circuitId = value; }
public string Url { get => url; set => url = value; }
public string CircuitName { get => circuitName; set => circuitName = value; }
public RaceLocation Location { get; set; }
}
public class Results
{
int number;
int position;
int points;
int grid;
int laps;
string positionText;
string status;
public int Number { get => number; set => number = value; }
public int Position { get => position; set => position = value; }
public string PositionText { get => positionText; set => positionText = value; }
public int Points { get => points; set => points = value; }
public Driver Driver { get; set; }
public Constructor Constructor { get; set; }
public int Grid { get => grid; set => grid = value; }
public int Laps { get => laps; set => laps = value; }
public string Status { get => status; set => status = value; }
public ResultsTime Time { get; set; }
public FastestLap FastestLap { get; set; }
}
public class Driver
{
string driverId;
public string DriverId { get => driverId; set => driverId = value; }
}
public class Constructor
{
string constructorId;
public string ConstructorId { get => constructorId; set => constructorId = value; }
}
public class ResultsTime
{
int millis;
string time;
public int Millis { get => millis; set => millis = value; }
public string Time { get => time; set => time = value; }
}
public class FastestLap
{
int rank;
int lap;
public int Rank { get => rank; set => rank = value; }
public int Lap { get => lap; set => lap = value; }
public LapTime Time { get; set; }
public AverageSpeed AverageSpeed { get; set; }
}
public class LapTime
{
string time;
public string Time { get => time; set => time = value; }
}
public class AverageSpeed
{
string units;
float speed;
public string Units { get => units; set => units = value; }
public float Speed { get => speed; set => speed = value; }
}
public class RaceLocation
{
string lat;
string @long;
string locality;
string country;
public string Lat { get => lat; set => lat = value; }
public string Long { get => @long; set => @long = value; }
public string Locality { get => locality; set => locality = value; }
public string Country { get => country; set => country = value; }
}
}