From 5235345620c0d4a6669ccc6badc387902ea8c92a Mon Sep 17 00:00:00 2001 From: nsensfel Date: Wed, 28 Feb 2018 13:59:39 +0100 Subject: Adds more types specifications. --- src/reply/add_char.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/reply/add_char.erl') diff --git a/src/reply/add_char.erl b/src/reply/add_char.erl index 7d30bac..42c3359 100644 --- a/src/reply/add_char.erl +++ b/src/reply/add_char.erl @@ -12,6 +12,11 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec attributes_as_json + ( + attributes:struct() + ) -> + {list({binary(), non_neg_integer()})}. attributes_as_json (Attributes) -> { [ @@ -24,6 +29,7 @@ attributes_as_json (Attributes) -> ] }. +-spec encode (non_neg_integer(), character_instance:struct()) -> binary(). encode (IX, CharacterInstance) -> Character = character_instance:get_character(CharacterInstance), {X, Y} = character_instance:get_location(CharacterInstance), @@ -56,5 +62,11 @@ encode (IX, CharacterInstance) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec generate + ( + non_neg_integer(), + character_instance:struct() + ) + -> list(binary()). generate (IX, CharacterInstance) -> [<<"add_char">>, encode(IX, CharacterInstance)]. -- cgit v1.2.3-70-g09d2