Skip to content

PokeD/PokeAPI-NJ.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PokeApi.NET

NuGet package

A .NET Wrapper for http://www.pokeapi.co/. See the master branch for the v1 version.

Usage:

C#

using System;
using PokeAPI;

// [...]

// in async method

PokemonSpecies p = await DataFetcher.GetApiObject<PokemonSpecies>(395);
// or:
PokemonSpecies p = await DataFetcher.GetNamedApiObject<PokemonSpecies>("lucario");

float cRate = p.CaptureRate;
// etc

To get the value behind the Task<T> object synchronously, use the Result property.

F#

open System
open PokeAPI

// [...]

async
{
    let! p = DataFetcher.GetApiObject<PokemonSpecies> 395 |> Async.AwaitTask;
    // or:
    let! p = DataFetcher.GetNamedApiObject<PokemonSpecies> "lucario" |> Async.AwaitTask;

    let cRate = p.CaptureRate;
    // etc
}

To get the value behind the Async<T> object synchronously, use the Async.RunSynchronously function. If it's a Task<T>, do as described under 'C#'.

Docs

Separate docs for this library aren't really needed, everything is made to look like the pokeapi.co docs, but using more C#-like names. I might add separate methods for every api object type later.

About

PokeAPI.NET converted to work with Newtonsoft.Json

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages