diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..62c871c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "Minecraft" + ] +} \ No newline at end of file diff --git a/CFCoreAPI/CFCore.cs b/CFCoreAPI/CFCore.cs new file mode 100644 index 0000000..9909670 --- /dev/null +++ b/CFCoreAPI/CFCore.cs @@ -0,0 +1,44 @@ +using System.Net.Http; +using CFCoreAPI.Endpoints.Categories; +using CFCoreAPI.Endpoints.Files; +using CFCoreAPI.Endpoints.Fingerprints; +using CFCoreAPI.Endpoints.Games; +using CFCoreAPI.Endpoints.Minecraft; +using CFCoreAPI.Endpoints.Mods; + +namespace CFCoreAPI +{ + public class CFCoreAPI + { + private readonly string _apiKey; + public HttpClient HttpClient { get; private set; } + + public CFCoreAPI(string key) + { + this._apiKey = key; + this.HttpClient = new HttpClient(); + this.HttpClient.BaseAddress = new Uri("https://api.curseforge.com"); + this.HttpClient.DefaultRequestHeaders.Add("x-api-key", _apiKey); + + this._gamesAPI = new Lazy(() => new GamesAPI(HttpClient)); + this._categoriesAPI = new Lazy(() => new CategoriesAPI(HttpClient)); + this._modsAPI = new Lazy(() => new ModsAPI(HttpClient)); + this._filesAPI = new Lazy(() => new FilesAPI(HttpClient)); + this._fingerprintAPI = new Lazy(() => new FingerprintsAPI(HttpClient)); + this._minecraftAPI = new Lazy(() => new MinecraftAPI(HttpClient)); + } + private Lazy _gamesAPI; + public GamesAPI Games => this._gamesAPI.Value; + private Lazy _categoriesAPI; + public CategoriesAPI Categories => this._categoriesAPI.Value; + private Lazy _modsAPI; + public ModsAPI Mods => this._modsAPI.Value; + private Lazy _filesAPI; + public FilesAPI Files => this._filesAPI.Value; + private Lazy _fingerprintAPI; + public FingerprintsAPI Fingerprints => this._fingerprintAPI.Value; + private Lazy _minecraftAPI; + public MinecraftAPI Minecraft => this._minecraftAPI.Value; + } + +} \ No newline at end of file diff --git a/CFCoreAPI/CFCoreAPI.cs b/CFCoreAPI/CFCoreAPI.cs deleted file mode 100644 index 93b4173..0000000 --- a/CFCoreAPI/CFCoreAPI.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Net.Http; -using CFCoreAPI.Endpoints.Files; -using CFCoreAPI.Endpoints.Games; - -namespace CFCoreAPI -{ - public class CFCoreAPI - { - private readonly string _apiKey; - public HttpClient HttpClient { get; private set; } - - public CFCoreAPI(string key) - { - this._apiKey = key; - this.HttpClient = new HttpClient(); - this.HttpClient.BaseAddress = new Uri("https://api.curseforge.com"); - this.HttpClient.DefaultRequestHeaders.Add("x-api-key", _apiKey); - - this._gamesAPI = new Lazy(() => new GamesAPI(HttpClient)); - this._filesAPI = new Lazy(() => new FilesAPI(HttpClient)); - } - private Lazy _gamesAPI; - public GamesAPI GamesAPI => this._gamesAPI.Value; - private Lazy _filesAPI; - public FilesAPI FilesAPI => this._filesAPI.Value; - } - -} \ No newline at end of file