Current section
Files
Jump to
Current section
Files
src/internal@pokemon@ability@ability.erl
-module(internal@pokemon@ability@ability).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([ability/0]).
-export_type([ability/0, effect/0, flavor_text/0]).
-type ability() :: {ability,
integer(),
binary(),
boolean(),
internal@common@affordance:affordance(),
list(internal@common@name:name()),
list(effect()),
list(flavor_text()),
list(internal@common@pokemon:pokemon_with_hidden())}.
-type effect() :: {effect,
binary(),
binary(),
internal@common@affordance:affordance()}.
-type flavor_text() :: {flavor_text,
binary(),
internal@common@affordance:affordance(),
internal@common@affordance:affordance()}.
-spec effect() -> decode:decoder(effect()).
effect() ->
_pipe = decode:into(
(decode:parameter(
fun(Effect) ->
decode:parameter(
fun(Short_effect) ->
decode:parameter(
fun(Language) ->
{effect, Effect, Short_effect, Language}
end
)
end
)
end
))
),
_pipe@1 = decode:field(
_pipe,
<<"effect"/utf8>>,
{decoder, fun gleam@dynamic:string/1}
),
_pipe@2 = decode:field(
_pipe@1,
<<"short_effect"/utf8>>,
{decoder, fun gleam@dynamic:string/1}
),
decode:field(
_pipe@2,
<<"language"/utf8>>,
internal@common@affordance:affordance()
).
-spec flavor_text() -> decode:decoder(flavor_text()).
flavor_text() ->
_pipe = decode:into(
(decode:parameter(
fun(Text) ->
decode:parameter(
fun(Language) ->
decode:parameter(
fun(Version_group) ->
{flavor_text, Text, Language, Version_group}
end
)
end
)
end
))
),
_pipe@1 = decode:field(
_pipe,
<<"flavor_text"/utf8>>,
{decoder, fun gleam@dynamic:string/1}
),
_pipe@2 = decode:field(
_pipe@1,
<<"language"/utf8>>,
internal@common@affordance:affordance()
),
decode:field(
_pipe@2,
<<"version_group"/utf8>>,
internal@common@affordance:affordance()
).
-spec ability() -> decode:decoder(ability()).
ability() ->
_pipe = decode:into(
(decode:parameter(
fun(Id) ->
decode:parameter(
fun(Name) ->
decode:parameter(
fun(Is_main_series) ->
decode:parameter(
fun(Generation) ->
decode:parameter(
fun(Names) ->
decode:parameter(
fun(Effect_entries) ->
decode:parameter(
fun(Flavor_texts) ->
decode:parameter(
fun(Pokemon) ->
{ability,
Id,
Name,
Is_main_series,
Generation,
Names,
Effect_entries,
Flavor_texts,
Pokemon}
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
))
),
_pipe@1 = decode:field(
_pipe,
<<"id"/utf8>>,
{decoder, fun gleam@dynamic:int/1}
),
_pipe@2 = decode:field(
_pipe@1,
<<"name"/utf8>>,
{decoder, fun gleam@dynamic:string/1}
),
_pipe@3 = decode:field(
_pipe@2,
<<"is_main_series"/utf8>>,
{decoder, fun gleam@dynamic:bool/1}
),
_pipe@4 = decode:field(
_pipe@3,
<<"generation"/utf8>>,
internal@common@affordance:affordance()
),
_pipe@5 = decode:field(
_pipe@4,
<<"names"/utf8>>,
decode:list(internal@common@name:name())
),
_pipe@6 = decode:field(
_pipe@5,
<<"effect_entries"/utf8>>,
decode:list(effect())
),
_pipe@7 = decode:field(
_pipe@6,
<<"flavor_text_entries"/utf8>>,
decode:list(flavor_text())
),
decode:field(
_pipe@7,
<<"pokemon"/utf8>>,
decode:list(internal@common@pokemon:pokemon_with_hidden())
).