summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-10-23 17:46:45 +0200
committernsensfel <SpamShield0@noot-noot.org>2019-10-23 17:46:45 +0200
commit65a2b95f7355b6b495516b95dafa63f8ccaa2bb0 (patch)
tree05011efdd963f8aa017d508bab1386eb90379df2 /src/battle/struct/btl_character.erl
parent240b60a2a747d073eb001dd92450fd19b91902e9 (diff)
...
Diffstat (limited to 'src/battle/struct/btl_character.erl')
-rw-r--r--src/battle/struct/btl_character.erl28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/battle/struct/btl_character.erl b/src/battle/struct/btl_character.erl
index 51d6191..6a4fe2f 100644
--- a/src/battle/struct/btl_character.erl
+++ b/src/battle/struct/btl_character.erl
@@ -102,7 +102,6 @@
resolve/2,
is_unresolved/1,
to_unresolved/1,
- decode/1,
encode/1
]
).
@@ -490,7 +489,7 @@ ataxia_set_conditions (Conditions, Char) ->
rank(),
shr_location:type(),
shr_character:type(),
- list(btl_condition:type())
+ btl_condition:collection()
)
-> type().
new
@@ -563,25 +562,6 @@ get_base_character_field () -> #btl_char_ref.base.
-spec get_conditions_field() -> non_neg_integer().
get_conditions_field () -> #btl_char_ref.conditions.
--spec decode (map()) -> unresolved().
-decode (Map) ->
- #btl_char_ref
- {
- player_ix = maps:get(?PLAYER_IX_FIELD, Map),
- rank = maps:get(?RANK_FIELD, Map),
- location = shr_location:decode(maps:get(?LOCATION_FIELD, Map)),
- current_health = maps:get(?CURRENT_HEALTH_FIELD, Map),
- is_active = maps:get(?IS_ACTIVE_FIELD, Map),
- is_defeated = maps:get(?IS_DEFEATED_FIELD, Map),
- base = shr_character:decode(maps:get(?BASE_CHAR_FIELD, Map)),
- conditions =
- lists:map
- (
- fun btl_condition:decode/1,
- maps:get(?CONDITIONS_FIELD, Map)
- )
- }.
-
-spec encode (unresolved()) -> {list({binary(), any()})}.
encode (CharRef) ->
{
@@ -595,11 +575,7 @@ encode (CharRef) ->
{?BASE_CHAR_FIELD, shr_character:encode(CharRef#btl_char_ref.base)},
{
?CONDITIONS_FIELD,
- lists:map
- (
- fun btl_condition:encode/1,
- CharRef#btl_char_ref.conditions
- )
+ btl_condition:encode_collection(CharRef#btl_char_ref.conditions)
}
]
}.