summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2017-11-10 13:03:11 +0100
committernsensfel <SpamShield0@noot-noot.org>2017-11-10 13:03:11 +0100
commit5621bd5d513a2be44608f09f2b821e42387dd8f0 (patch)
tree4fc3d35b7921c970effd2725a59d9820f9309421 /src/battlemap_character.erl
parentfde7249bb3b185f2447585e9406775f351133632 (diff)
Still have to create the ETS tables...
Diffstat (limited to 'src/battlemap_character.erl')
-rw-r--r--src/battlemap_character.erl30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/battlemap_character.erl b/src/battlemap_character.erl
new file mode 100644
index 0000000..b831340
--- /dev/null
+++ b/src/battlemap_character.erl
@@ -0,0 +1,30 @@
+-module(battlemap_character).
+-export([encode_in_json/1]).
+
+encode_in_json (
+ {
+ ID,
+ Name,
+ Icon,
+ Portrait,
+ {X, Y},
+ Team,
+ MovementPoints,
+ AttackRange
+ }
+) ->
+ jiffy:encode(
+ {
+ [
+ {<<"id">>, ID},
+ {<<"name">>, Name},
+ {<<"icon">>, Icon},
+ {<<"portait">>, Portrait},
+ {<<"loc_x">>, X},
+ {<<"loc_y">>, Y},
+ {<<"team">>, Team},
+ {<<"mov_pts">>, MovementPoints},
+ {<<"atk_rg">>, AttackRange}
+ ]
+ }
+ ).