From 83cd7ce064b8a46a106dc855d748b1bd7e45af01 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Fri, 4 Jan 2019 17:25:39 +0100 Subject: Removes 'id' field from ataxia entry values. While sometimes usefull as a way to retrieve the object's ID, they were both redundant (you can't get the object without its ID anyway) and bothersome to maintain (insert + update, which would have required setting up a bounty for any insert). --- src/battle/struct/btl_pending_battle.erl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/battle/struct/btl_pending_battle.erl') diff --git a/src/battle/struct/btl_pending_battle.erl b/src/battle/struct/btl_pending_battle.erl index cecaeb5..a69e6ce 100644 --- a/src/battle/struct/btl_pending_battle.erl +++ b/src/battle/struct/btl_pending_battle.erl @@ -3,13 +3,12 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --type id() :: binary(). +-type id() :: ataxia_id:type(). -record ( pending_battle, { - id :: id(), free_slots :: non_neg_integer(), battle :: btl_battle:type() } @@ -29,7 +28,6 @@ -export ( [ - get_id/1, get_battle/1, get_free_slots/1, @@ -44,7 +42,7 @@ -export ( [ - new/3 + new/2 ] ). @@ -55,19 +53,15 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --spec new (id(), non_neg_integer(), btl_battle:type()) -> type(). -new (ID, FreeSlots, Battle) -> +-spec new (non_neg_integer(), btl_battle:type()) -> type(). +new (FreeSlots, Battle) -> #pending_battle { - id = ID, free_slots = FreeSlots, battle = Battle }. %%%% Accessors --spec get_id (type()) -> id(). -get_id (PBattle) -> PBattle#pending_battle.id. - -spec get_battle (type()) -> btl_battle:type(). get_battle (PBattle) -> PBattle#pending_battle.battle. -- cgit v1.2.3-70-g09d2