summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-08-02 20:23:01 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-08-02 20:23:01 +0200 |
commit | 6869f9a8aaab7618dd49cbb47388838fc883ceb9 (patch) | |
tree | 271d743e9ece766a3fd6fb21c9c6ca608b06d9c5 /src/battle/struct/btl_map.erl | |
parent | c0349f22f281940bd2f9b3cf670b21dc895dca85 (diff) |
Getting the map editor up to date...
Diffstat (limited to 'src/battle/struct/btl_map.erl')
-rw-r--r-- | src/battle/struct/btl_map.erl | 18 |
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) }. |