From e5bc1b2d1bfcf5f36bd4f0d567e4ec8e0fb22e85 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 5 Mar 2018 17:43:23 +0100 Subject: Fixes issues I expected Dialyzer to show me. --- src/struct/turn_result.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/struct/turn_result.erl') diff --git a/src/struct/turn_result.erl b/src/struct/turn_result.erl index d8ca2be..c5cafcd 100644 --- a/src/struct/turn_result.erl +++ b/src/struct/turn_result.erl @@ -17,7 +17,7 @@ moved, { character_instance_ix :: character_instance:id(), - path :: [direction:enum()], + path :: list(direction:enum()), new_location :: location:type() } ). @@ -28,7 +28,7 @@ { attacker_ix :: character_instance:id(), defender_ix :: character_instance:id(), - sequence :: list(attack:attack_desc()) + sequence :: list(attack:struct()) } ). @@ -85,7 +85,7 @@ new_character_moved (CharacterInstanceIX, Path, NewLocation) -> ( character_instance:id(), character_instance:id(), - list(attack:attack_desc()) + list(attack:struct()) ) -> struct(). new_character_attacked (AttackerIX, DefenderIX, AttackSequence) -> @@ -145,4 +145,7 @@ encode (TurnResult) when is_record(TurnResult, attacked) -> {<<"seq">>, EncodedSequence} ] } - ). + ); +encode (Other) -> + io:format("~n invalid encode param\"~p\"~n", [Other]), + true = Other. -- cgit v1.2.3-70-g09d2