summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-03-05 13:51:14 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-03-05 13:51:14 +0100
commit6a82ead205f4463ee34cc4fcbc06f1b3e7b1dd1a (patch)
tree6b9fa780865044b8c57800d48fe251e4dff2d6f6 /src/struct/direction.erl
parent10b1058e56079232728e3fc959709bc784e58b5b (diff)
Starting to work on the client diff messages.
Diffstat (limited to 'src/struct/direction.erl')
-rw-r--r--src/struct/direction.erl23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/struct/direction.erl b/src/struct/direction.erl
index 074cadf..84ae272 100644
--- a/src/struct/direction.erl
+++ b/src/struct/direction.erl
@@ -12,8 +12,8 @@
-export
(
[
- from_binary/1,
- to_binary/1
+ decode/1,
+ encode/1
]
).
@@ -24,13 +24,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--spec from_binary (binary()) -> enum().
-from_binary (<<"U">>) -> up;
-from_binary (<<"D">>) -> down;
-from_binary (<<"L">>) -> left;
-from_binary (<<"R">>) -> right.
+-spec decode (binary()) -> enum().
+decode (<<"U">>) -> up;
+decode (<<"D">>) -> down;
+decode (<<"L">>) -> left;
+decode (<<"R">>) -> right.
-to_binary (up) -> <<"U">>;
-to_binary (down) -> <<"D">>;
-to_binary (left) -> <<"L">>;
-to_binary (right) -> <<"R">>.
+-spec encode (enum()) -> binary().
+encode (up) -> <<"U">>;
+encode (down) -> <<"D">>;
+encode (left) -> <<"L">>;
+encode (right) -> <<"R">>.