From 5235345620c0d4a6669ccc6badc387902ea8c92a Mon Sep 17 00:00:00 2001 From: nsensfel Date: Wed, 28 Feb 2018 13:59:39 +0100 Subject: Adds more types specifications. --- src/struct/battlemap.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/struct/battlemap.erl') diff --git a/src/struct/battlemap.erl b/src/struct/battlemap.erl index 76f8fd4..8f85bbb 100644 --- a/src/struct/battlemap.erl +++ b/src/struct/battlemap.erl @@ -81,14 +81,20 @@ get_height (Battlemap) -> Battlemap#battlemap.height. -spec get_tile_ids (struct()) -> array:array(tile:id()). get_tile_ids (Battlemap) -> Battlemap#battlemap.tile_ids. --spec random (id(), non_neg_integer(), non_neg_integer()) -> struct(). +-spec random + ( + non_neg_integer(), + non_neg_integer(), + non_neg_integer() + ) + -> struct(). random (ID, Width, Height) -> InitialTile = tile:random_id(), TileIDs = generate_random_tile_ids(InitialTile, [], Width, Height, Width), #battlemap { - id = ID, + id = list_to_binary(integer_to_list(ID)), width = Width, height = Height, tile_ids = array:from_list(TileIDs) -- cgit v1.2.3-70-g09d2