| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-08-02 16:42:51 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-08-02 16:42:51 +0200 | 
| commit | c0349f22f281940bd2f9b3cf670b21dc895dca85 (patch) | |
| tree | 8e29927872c4175e1ce7a2b3e108bc23bf56a9e4 /src/battle/struct/btl_map.erl | |
| parent | 234193c59f79a71b4aedb5cdcc748fb70ef52712 (diff) | |
Moves to the new tile format.
Diffstat (limited to 'src/battle/struct/btl_map.erl')
| -rw-r--r-- | src/battle/struct/btl_map.erl | 22 | 
1 files changed, 11 insertions, 11 deletions
| diff --git a/src/battle/struct/btl_map.erl b/src/battle/struct/btl_map.erl index 83cf455..ce39b19 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_class_ids :: array:array(btl_tile:class_id()) +      tile_ids :: array:array(btl_tile:id())     }  ). @@ -30,8 +30,8 @@        get_id/1,        get_width/1,        get_height/1, -      get_tile_class_ids/1, -      get_tile_class_id/2 +      get_tile_ids/1, +      get_tile_id/2     ]  ). @@ -72,29 +72,29 @@ get_width (Map) -> Map#map.width.  -spec get_height (type()) -> integer().  get_height (Map) -> Map#map.height. --spec get_tile_class_ids (type()) -> array:array(btl_tile:class_id()). -get_tile_class_ids (Map) -> Map#map.tile_class_ids. +-spec get_tile_ids (type()) -> array:array(btl_tile:id()). +get_tile_ids (Map) -> Map#map.tile_ids. --spec get_tile_class_id (btl_location:type(), type()) -> btl_tile:class_id(). -get_tile_class_id (Location, Map) -> +-spec get_tile_id (btl_location:type(), type()) -> btl_tile:id(). +get_tile_id (Location, Map) ->     TileIX = location_to_array_index(Map#map.width, Location), -   array:get(TileIX, Map#map.tile_class_ids). +   array:get(TileIX, Map#map.tile_ids).  -spec from_list     (        non_neg_integer(),        non_neg_integer(),        non_neg_integer(), -      list(non_neg_integer()) +      list({non_neg_integer(), non_neg_integer(), non_neg_integer()})     )     -> type().  from_list (ID, Width, Height, List) -> -   TileClassIDs = lists:map(fun btl_tile:class_id_from_int/1, List), +   TileIDs = lists:map(fun btl_tile:id_from_ints/1, List),     #map     {        id = list_to_binary(integer_to_list(ID)),        width = Width,        height = Height, -      tile_class_ids = array:from_list(TileClassIDs) +      tile_ids = array:from_list(TileIDs)     }. | 


