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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-spec generate (shr_tile:type()) -> {list(any())}.
generate (Tile) ->
{
[
{<<"msg">>, <<"add_tile">>},
{<<"id">>, shr_tile:get_class_id(Tile)},
{<<"nam">>, shr_tile:get_name(Tile)},
{<<"ct">>, shr_tile:get_cost(Tile)},
{<<"omni">>, shr_omnimods:encode(shr_tile:get_omnimods(Tile))}
]
}.
|