Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 2b437cb

Browse files
author
Not Officer
committed
refactor of the v1 implementation
1 parent 913b9cb commit 2b437cb

41 files changed

Lines changed: 1074 additions & 854 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Fortnite-API.Test/Fortnite-API.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<RootNamespace>Fortnite_API.Test</RootNamespace>
77
</PropertyGroup>
88

src/Fortnite-API.Test/Program.cs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,67 @@
11
using System.Diagnostics;
22
using System.Threading.Tasks;
33

4+
using Fortnite_API;
45
using Fortnite_API.Objects;
6+
using Fortnite_API.Objects.V1;
57

6-
namespace Fortnite_API.Test
8+
namespace Fortnite_api.Test
79
{
810
internal class Program
911
{
1012
private static async Task Main()
1113
{
12-
const string apiKey = "your-api-key";
14+
const string apiKey = null; // optional as of now. check https://dash.fortnite-api.com to be sure
1315
var api = new FortniteApi(apiKey);
1416

15-
var aes = await api.Aes.GetAsync();
17+
var aes = await api.V1.Aes.GetAsync();
1618
await Task.Delay(500);
17-
var tfueCode = await api.CreatorCode.GetAsync("tfue");
19+
var tfueCode = await api.V1.CreatorCode.GetAsync("tfue");
1820
await Task.Delay(500);
19-
var searchTestCode = await api.CreatorCode.SearchAsync("test");
21+
var searchTestCode = await api.V1.CreatorCode.SearchAsync("test");
2022
await Task.Delay(500);
21-
var searchAllTestCode = await api.CreatorCode.SearchAllAsync("test");
23+
var searchAllTestCode = await api.V1.CreatorCode.SearchAllAsync("test");
2224
await Task.Delay(500);
2325

24-
var cosmetics = await api.Cosmetics.GetBrAsync(GameLanguage.DE);
26+
var cosmetics = await api.V1.Cosmetics.GetBrAsync(GameLanguage.DE);
2527
await Task.Delay(500);
2628

27-
var johnWickById = await api.Cosmetics.GetBrAsync("bid_271_assassinsuitmale");
29+
var johnWickById = await api.V1.Cosmetics.GetBrAsync("bid_271_assassinsuitmale");
2830
await Task.Delay(500);
2931

30-
var johnWick_ghoulTrooperSearch = await api.Cosmetics.SearchBrIdsAsync(new []
32+
var johnWick_ghoulTrooperSearch = await api.V1.Cosmetics.SearchBrIdsAsync(new []
3133
{
3234
"bid_271_assassinsuitmale",
3335
"cid_029_athena_commando_f_halloween"
3436
});
3537
await Task.Delay(500);
3638

37-
var johnWickSearch = await api.Cosmetics.SearchBrAsync(x =>
39+
var johnWickSearch = await api.V1.Cosmetics.SearchBrAsync(x =>
3840
{
3941
x.Name = "ohn wic";
4042
x.MatchMethod = MatchMethod.Contains;
4143
});
4244
await Task.Delay(500);
4345

44-
var allIconSeriesSearch = await api.Cosmetics.SearchAllBrAsync(x =>
46+
var allIconSeriesSearch = await api.V1.Cosmetics.SearchAllBrAsync(x =>
4547
{
46-
x.Rarity = BrCosmeticRarity.Icon;
48+
x.Rarity = BrCosmeticV1Rarity.Icon;
4749
});
4850
await Task.Delay(500);
4951

50-
var shop = await api.Shop.GetBrAsync();
52+
var shop = await api.V1.Shop.GetBrAsync();
5153
await Task.Delay(500);
5254

53-
var news = await api.News.GetAsync();
55+
var news = await api.V1.News.GetAsync();
5456
await Task.Delay(500);
5557

56-
var newsBr = await api.News.GetBrAsync();
58+
var newsBr = await api.V1.News.GetBrAsync();
5759
await Task.Delay(500);
5860

59-
var newsStw = await api.News.GetStwAsync();
61+
var newsStw = await api.V1.News.GetStwAsync();
6062
await Task.Delay(500);
6163

62-
var newsCreative = await api.News.GetCreativeAsync();
64+
var newsCreative = await api.V1.News.GetCreativeAsync();
6365

6466
Debugger.Break();
6567
}

src/Fortnite-API/Endpoints/AesEndpoint.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Fortnite-API/Endpoints/CosmeticsEndpoint.cs

Lines changed: 0 additions & 136 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using RestSharp;
2+
3+
namespace Fortnite_API.Endpoints
4+
{
5+
public abstract class EndpointBase
6+
{
7+
internal readonly IRestClient _client;
8+
9+
internal EndpointBase(IRestClient client)
10+
{
11+
_client = client;
12+
}
13+
}
14+
}

src/Fortnite-API/Endpoints/NewsEndpoints.cs

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)