-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MW2.cs
53 lines (46 loc) · 3.03 KB
/
MW2.cs
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
namespace CSharp_CODAPI
{
public class MW2
{
public async Task<BaseAPIResponse?> fullData(string gamertag, Platforms platform)
{
(gamertag, var platformStr, var lookupType) = Helpers.mapGamertagToPlatform(gamertag, platform);
return await Http.sendRequest<BaseAPIResponse>($"/stats/cod/v1/title/mw2/platform/{platformStr}/{lookupType}/{gamertag}/profile/type/mp");
}
public async Task<BaseAPIResponse?> combatHistory(string gamertag, Platforms platform)
{
(gamertag, var platformStr, var lookupType) = Helpers.mapGamertagToPlatform(gamertag, platform);
return await Http.sendRequest<BaseAPIResponse>($"/crm/cod/v2/title/mw2/platform/{platformStr}/{lookupType}/{gamertag}/matches/mp/start/0/end/0/details");
}
public async Task<BaseAPIResponse?> combatHistory(string gamertag, Platforms platform, long startTime, long endTime)
{
(gamertag, var platformStr, var lookupType) = Helpers.mapGamertagToPlatform(gamertag, platform);
return await Http.sendRequest<BaseAPIResponse>($"/crm/cod/v2/title/mw2/platform/{platformStr}/{lookupType}/{gamertag}/matches/mp/start/{startTime}/end/{endTime}/details");
}
public async Task<BaseAPIResponse?> breakdown(string gamertag, Platforms platform)
{
(gamertag, var platformStr, var lookupType) = Helpers.mapGamertagToPlatform(gamertag, platform);
return await Http.sendRequest<BaseAPIResponse>($"/crm/cod/v2/title/mw2/platform/{platformStr}/{lookupType}/{gamertag}/matches/mp/start/0/end/0");
}
public async Task<BaseAPIResponse?> breakdown(string gamertag, Platforms platform, long startTime, long endTime)
{
(gamertag, var platformStr, var lookupType) = Helpers.mapGamertagToPlatform(gamertag, platform);
return await Http.sendRequest<BaseAPIResponse>($"/crm/cod/v2/title/mw2/platform/{platformStr}/{lookupType}/{gamertag}/matches/mp/start/{startTime}/end/{endTime}");
}
public async Task<BaseAPIResponse?> seasonLoot(string gamertag, Platforms platform)
{
(gamertag, var platformStr, var lookupType) = Helpers.mapGamertagToPlatform(gamertag, platform);
return await Http.sendRequest<BaseAPIResponse>($"/loot/title/mw2/platform/{platformStr}/{lookupType}/{gamertag}/status/en");
}
public async Task<BaseAPIResponse?> mapList(Platforms platform)
{
(_, var platformStr, _) = Helpers.mapGamertagToPlatform(string.Empty, platform);
return await Http.sendRequest<BaseAPIResponse>($"/ce/v1/title/mw2/platform/${platformStr}/gameType/mp/communityMapData/availability");
}
public async Task<BaseAPIResponse?> matchInfo(string matchId, Platforms platform)
{
(_, var platformStr, _) = Helpers.mapGamertagToPlatform(string.Empty, platform);
return await Http.sendRequest<BaseAPIResponse>($"/crm/cod/v2/title/mw2/platform/{platformStr}/fullMatch/mp/{matchId}/en");
}
}
}