summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-01-23 18:43:13 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-01-23 18:43:13 +0100 |
commit | 14e79da8b8d45ef242aee34cf4376d220846f690 (patch) | |
tree | e263b48464dd95adae6fb37e25d121869c5e4b77 /src/battle/game-logic/btl_movement.erl | |
parent | 366b7e737d74a79e035d6e1a40b041c015f89baa (diff) |
Cleaning up a bit...
Diffstat (limited to 'src/battle/game-logic/btl_movement.erl')
-rw-r--r-- | src/battle/game-logic/btl_movement.erl | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/battle/game-logic/btl_movement.erl b/src/battle/game-logic/btl_movement.erl deleted file mode 100644 index dd7eff9..0000000 --- a/src/battle/game-logic/btl_movement.erl +++ /dev/null @@ -1,60 +0,0 @@ --module(btl_movement). - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([cross/4]). - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --spec cross - ( - btl_map:type(), - list(btl_location:type()), - list(btl_direction:enum()), - non_neg_integer(), - btl_location:type() - ) - -> {btl_location:type(), non_neg_integer()}. -cross (_Map, _ForbiddenLocations, [], Cost, Location) -> - {Location, Cost}; -cross (Map, ForbiddenLocations, [Step|NextSteps], Cost, Location) -> - NextLocation = btl_location:apply_direction(Step, Location), - NextTileInstance = btl_map:get_tile_instance(NextLocation, Map), - NextTileClassID = shr_tile:extract_main_class_id(NextTileInstance), - NextTile = shr_tile:from_class_id(NextTileClassID), - NextCost = (Cost + shr_tile:get_cost(NextTile)), - IsForbidden = - lists:foldl - ( - fun (ForbiddenLocation, Prev) -> - (Prev or (NextLocation == ForbiddenLocation)) - end, - false, - ForbiddenLocations - ), - - IsForbidden = false, - - cross(Map, ForbiddenLocations, NextSteps, NextCost, NextLocation). - --spec cross - ( - btl_map:type(), - list(btl_location:type()), - list(btl_direction:enum()), - btl_location:type() - ) - -> {btl_location:type(), non_neg_integer()}. -cross (Map, ForbiddenLocations, Path, Location) -> - cross(Map, ForbiddenLocations, Path, 0, Location). |