summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-03-06 17:08:00 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-03-06 17:08:00 +0100
commit98203d4d0034dab5db72737bcfb92017a11f3245 (patch)
tree9c4fd2a8904468d7ee69d86e39ce27051cc8ca2d /src/struct/attack.erl
parente5bc1b2d1bfcf5f36bd4f0d567e4ec8e0fb22e85 (diff)
I might have been using JSON the wrong way.refactoring
Diffstat (limited to 'src/struct/attack.erl')
-rw-r--r--src/struct/attack.erl23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/struct/attack.erl b/src/struct/attack.erl
index 7b81adc..7f6b302 100644
--- a/src/struct/attack.erl
+++ b/src/struct/attack.erl
@@ -281,7 +281,7 @@ get_sequence (AttackRange, AttackerWeapon, DefenderWeapon) ->
[First, Counter, Second]
end.
--spec encode (struct()) -> binary().
+-spec encode (struct()) -> {list(any())}.
% This shouldn't be a possibility. Types in this module are a mess...
encode (Attack) ->
Order = Attack#attack.order,
@@ -290,15 +290,12 @@ encode (Attack) ->
IsParry = Attack#attack.is_parry,
Damage = Attack#attack.damage,
- jiffy:encode
- (
- {
- [
- {<<"ord">>, encode_order(Order)},
- {<<"pre">>, encode_precision(Precision)},
- {<<"cri">>, IsCritical},
- {<<"par">>, IsParry},
- {<<"dmg">>, Damage}
- ]
- }
- ).
+ {
+ [
+ {<<"ord">>, encode_order(Order)},
+ {<<"pre">>, encode_precision(Precision)},
+ {<<"cri">>, IsCritical},
+ {<<"par">>, IsParry},
+ {<<"dmg">>, Damage}
+ ]
+ }.