summaryrefslogtreecommitdiff |
diff options
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(). |