예제 #1
0
    public async Task <IActionResult> CheckShowdownLegality([FromRoute] string game, [FromBody, Required] PokemonShowdownRequest body)
    {
        var pkm = await PokemonService.GetPokemonFromShowdown(body.ShowdownSet, GetGameFromString(game));

        if (pkm.IsLegal())
        {
            return(NoContent());
        }

        throw new LegalityException("Pokemon couldn't be legalized!");
    }
예제 #2
0
    public async Task <IActionResult> GetPokemonFromShowdown([FromRoute] string game, [FromBody, Required] PokemonShowdownRequest body)
    {
        var pkm = await PokemonService.GetPokemonFromShowdown(body.ShowdownSet, GetGameFromString(game));

        return(await ReturnPokemonFile(pkm, IsEncryptionWanted));
    }