summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle/struct/btl_map.erl')
-rw-r--r--src/battle/struct/btl_map.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/battle/struct/btl_map.erl b/src/battle/struct/btl_map.erl
index ce39b19..cfa8c1e 100644
--- a/src/battle/struct/btl_map.erl
+++ b/src/battle/struct/btl_map.erl
@@ -12,7 +12,7 @@
id :: id(),
width :: integer(),
height :: integer(),
- tile_ids :: array:array(btl_tile:id())
+ tile_ids :: array:array(btl_tile:instance())
}
).
@@ -30,8 +30,8 @@
get_id/1,
get_width/1,
get_height/1,
- get_tile_ids/1,
- get_tile_id/2
+ get_tile_instances/1,
+ get_tile_instance/2
]
).
@@ -72,11 +72,11 @@ get_width (Map) -> Map#map.width.
-spec get_height (type()) -> integer().
get_height (Map) -> Map#map.height.
--spec get_tile_ids (type()) -> array:array(btl_tile:id()).
-get_tile_ids (Map) -> Map#map.tile_ids.
+-spec get_tile_instances (type()) -> array:array(btl_tile:instance()).
+get_tile_instances (Map) -> Map#map.tile_ids.
--spec get_tile_id (btl_location:type(), type()) -> btl_tile:id().
-get_tile_id (Location, Map) ->
+-spec get_tile_instance (btl_location:type(), type()) -> btl_tile:instance().
+get_tile_instance (Location, Map) ->
TileIX = location_to_array_index(Map#map.width, Location),
array:get(TileIX, Map#map.tile_ids).
@@ -89,12 +89,12 @@ get_tile_id (Location, Map) ->
)
-> type().
from_list (ID, Width, Height, List) ->
- TileIDs = lists:map(fun btl_tile:id_from_ints/1, List),
+ TileInstances = lists:map(fun btl_tile:instance_from_ints/1, List),
#map
{
id = list_to_binary(integer_to_list(ID)),
width = Width,
height = Height,
- tile_ids = array:from_list(TileIDs)
+ tile_ids = array:from_list(TileInstances)
}.