summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-02-28 13:59:39 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-02-28 13:59:39 +0100
commit5235345620c0d4a6669ccc6badc387902ea8c92a (patch)
tree0a8989ffd29b0a9d8ab997d763f15268d18de06a /src/struct/battlemap.erl
parent8ed3e625a5576b6f43b966ee77e0f6de282a074e (diff)
Adds more types specifications.
Diffstat (limited to 'src/struct/battlemap.erl')
-rw-r--r--src/struct/battlemap.erl10
1 files changed, 8 insertions, 2 deletions
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)