summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle/struct')
-rw-r--r--src/battle/struct/btl_battle.erl8
-rw-r--r--src/battle/struct/btl_character.erl14
-rw-r--r--src/battle/struct/btl_map.erl14
3 files changed, 18 insertions, 18 deletions
diff --git a/src/battle/struct/btl_battle.erl b/src/battle/struct/btl_battle.erl
index 97742aa..22c96f6 100644
--- a/src/battle/struct/btl_battle.erl
+++ b/src/battle/struct/btl_battle.erl
@@ -128,10 +128,10 @@ get_encoded_last_turns_effects (Battle) ->
get_all_timelines([], StartingPoint, CurrentPlayerIX, PlayersCount, Players).
-spec set_map (btl_map:type(), type()) -> type().
-set_map (Battlemap, Battle) ->
+set_map (Map, Battle) ->
Battle#battle
{
- map = Battlemap
+ map = Map
}.
-spec set_characters (array:array(btl_character:type()), type()) -> type().
@@ -192,14 +192,14 @@ set_current_player_turn (PlayerTurn, Battle) ->
list(btl_tile:id())
)
-> type().
-new (ID, PlayersAsList, Battlemap, CharactersAsList, UWIDs, UAIDs, UTIDs) ->
+new (ID, PlayersAsList, Map, CharactersAsList, UWIDs, UAIDs, UTIDs) ->
#battle
{
id = ID,
used_weapon_ids = UWIDs,
used_armor_ids = UAIDs,
used_tile_ids = UTIDs,
- map = Battlemap,
+ map = Map,
characters = array:from_list(CharactersAsList),
players = array:from_list(PlayersAsList),
current_player_turn = btl_player_turn:new(0, 0)
diff --git a/src/battle/struct/btl_character.erl b/src/battle/struct/btl_character.erl
index d9362ea..3f5c360 100644
--- a/src/battle/struct/btl_character.erl
+++ b/src/battle/struct/btl_character.erl
@@ -89,9 +89,9 @@
list({non_neg_integer(), non_neg_integer()})
)
-> {non_neg_integer(), non_neg_integer()}.
-find_random_location (BattlemapWidth, BattlemapHeight, ForbiddenLocations) ->
- X = shr_roll:between(0, (BattlemapWidth - 1)),
- Y = shr_roll:between(0, (BattlemapHeight - 1)),
+find_random_location (MapWidth, MapHeight, ForbiddenLocations) ->
+ X = shr_roll:between(0, (MapWidth - 1)),
+ Y = shr_roll:between(0, (MapHeight - 1)),
IsForbidden = lists:member({X, Y}, ForbiddenLocations),
@@ -99,8 +99,8 @@ find_random_location (BattlemapWidth, BattlemapHeight, ForbiddenLocations) ->
true ->
find_random_location
(
- BattlemapWidth,
- BattlemapHeight,
+ MapWidth,
+ MapHeight,
ForbiddenLocations
);
@@ -241,9 +241,9 @@ set_statistics (Stats, Char) ->
list({non_neg_integer(), non_neg_integer()})
)
-> type().
-random (ID, PlayerIX, BattlemapWidth, BattlemapHeight, ForbiddenLocations) ->
+random (ID, PlayerIX, MapWidth, MapHeight, ForbiddenLocations) ->
Location =
- find_random_location(BattlemapWidth, BattlemapHeight, ForbiddenLocations),
+ find_random_location(MapWidth, MapHeight, ForbiddenLocations),
WeaponIDs = {shr_weapon:random_id(), shr_weapon:random_id()},
ArmorID = shr_armor:random_id(),
Attributes = shr_attributes:random(),
diff --git a/src/battle/struct/btl_map.erl b/src/battle/struct/btl_map.erl
index ef34833..83cf455 100644
--- a/src/battle/struct/btl_map.erl
+++ b/src/battle/struct/btl_map.erl
@@ -64,21 +64,21 @@ location_to_array_index (ArrayWidth, {X, Y}) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Accessors
-spec get_id (type()) -> id().
-get_id (Battlemap) -> Battlemap#map.id.
+get_id (Map) -> Map#map.id.
-spec get_width (type()) -> integer().
-get_width (Battlemap) -> Battlemap#map.width.
+get_width (Map) -> Map#map.width.
-spec get_height (type()) -> integer().
-get_height (Battlemap) -> Battlemap#map.height.
+get_height (Map) -> Map#map.height.
-spec get_tile_class_ids (type()) -> array:array(btl_tile:class_id()).
-get_tile_class_ids (Battlemap) -> Battlemap#map.tile_class_ids.
+get_tile_class_ids (Map) -> Map#map.tile_class_ids.
-spec get_tile_class_id (btl_location:type(), type()) -> btl_tile:class_id().
-get_tile_class_id (Location, Battlemap) ->
- TileIX = location_to_array_index(Battlemap#map.width, Location),
- array:get(TileIX, Battlemap#map.tile_class_ids).
+get_tile_class_id (Location, Map) ->
+ TileIX = location_to_array_index(Map#map.width, Location),
+ array:get(TileIX, Map#map.tile_class_ids).
-spec from_list
(