From 1b72f37fc04cd7851bd2f289d7776a1c7c35f48d Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Mon, 18 Sep 2017 21:22:45 +0200 Subject: Adds backtrack support. --- client/elm/battlemap/src/Battlemap/Direction.elm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'client/elm/battlemap/src/Battlemap/Direction.elm') diff --git a/client/elm/battlemap/src/Battlemap/Direction.elm b/client/elm/battlemap/src/Battlemap/Direction.elm index b943c2d..e301177 100644 --- a/client/elm/battlemap/src/Battlemap/Direction.elm +++ b/client/elm/battlemap/src/Battlemap/Direction.elm @@ -1,4 +1,4 @@ -module Battlemap.Direction exposing (..) +module Battlemap.Direction exposing (Direction(..), opposite_of) type Direction = None @@ -6,3 +6,12 @@ type Direction = | Right | Up | Down + +opposite_of : Direction -> Direction +opposite_of d = + case d of + Left -> Right + Right -> Left + Up -> Down + Down -> Up + None -> None -- cgit v1.2.3-70-g09d2