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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-spec generate (shr_tile:type()) -> {list(any())}.
generate (Tile) ->
{
[
{<<"msg">>, <<"add_tile">>},
{<<"id">>, shr_tile:get_id(Tile)},
{<<"nam">>, shr_tile:get_name(Tile)},
{<<"ct">>, shr_tile:get_cost(Tile)},
{<<"de">>, 1}, % TODO: provide actual depth.
{<<"fa">>, <<"">>}, % TODO: provide actual family.
{<<"omni">>, shr_omnimods:encode(shr_tile:get_omnimods(Tile))}
]
}.
|