| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2018-02-28 13:59:39 +0100 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2018-02-28 13:59:39 +0100 | 
| commit | 5235345620c0d4a6669ccc6badc387902ea8c92a (patch) | |
| tree | 0a8989ffd29b0a9d8ab997d763f15268d18de06a /src/struct | |
| parent | 8ed3e625a5576b6f43b966ee77e0f6de282a074e (diff) | |
Adds more types specifications.
Diffstat (limited to 'src/struct')
| -rw-r--r-- | src/struct/battlemap.erl | 10 | ||||
| -rw-r--r-- | src/struct/character.erl | 2 | 
2 files changed, 9 insertions, 3 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) diff --git a/src/struct/character.erl b/src/struct/character.erl index bf6e046..96660ee 100644 --- a/src/struct/character.erl +++ b/src/struct/character.erl @@ -109,7 +109,7 @@ set_statistics (Stats, Char) ->  -spec random     ( -      id(), +      non_neg_integer(),        player:id()     )     -> struct(). | 


