summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-03-05 17:43:23 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-03-05 17:43:23 +0100
commite5bc1b2d1bfcf5f36bd4f0d567e4ec8e0fb22e85 (patch)
treee7637ad94f05b7484baa52f3a333af124c6b293a /src/struct/turn_result.erl
parent9b73f3efa534fa4dfb8ff832550c1914342ddbb9 (diff)
Fixes issues I expected Dialyzer to show me.
Diffstat (limited to 'src/struct/turn_result.erl')
-rw-r--r--src/struct/turn_result.erl11
1 files changed, 7 insertions, 4 deletions
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.