summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/type/battlemap.erl')
-rw-r--r-- | src/type/battlemap.erl | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/type/battlemap.erl b/src/type/battlemap.erl index cce1a76..d9d7b8c 100644 --- a/src/type/battlemap.erl +++ b/src/type/battlemap.erl @@ -1,4 +1,8 @@ -module(battlemap). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -record ( battlemap, @@ -10,6 +14,11 @@ instances } ). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors -export ( [ @@ -20,19 +29,31 @@ get_instances/1 ] ). +%%%% Utils -export ( - [dist/2] + [ + cross/5, + dist/2 + ] ). --export([cross/5]). +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors get_id (Battlemap) -> Battlemap#battlemap.id. get_width (Battlemap) -> Battlemap#battlemap.width. get_height (Battlemap) -> Battlemap#battlemap.height. list_tiles (Battlemap) -> array:sparse_to_list(Battlemap#battlemap.content). get_instances (Battlemap) -> Battlemap#battlemap.instances. --include("battlemap/cross.erl"). +%%%% Utils +-include("battlemap/cross_5.erl"). dist ({OX, OY}, {DX, DY}) -> (abs(OX - DX) + abs(OY + DY)). |