extracts Chest module, pulling out Route and Utils

This commit is contained in:
2019-11-06 16:09:50 +01:00
parent 7ee8c2e87c
commit 081ef1a89f
5 changed files with 442 additions and 380 deletions

25
src/Route.elm Normal file
View File

@@ -0,0 +1,25 @@
module Route exposing(..)
import Url
import Url.Parser as P exposing (Parser, (</>), oneOf, s)
---
-- ROUTES
---
type Route
= PlayerChest
| Merchant
| GroupLoot
| NewLoot
routeParser : Url.Url -> Maybe Route
routeParser url =
P.parse
(oneOf
[ P.map GroupLoot (P.s "coffre")
, P.map PlayerChest P.top
, P.map Merchant (P.s "marchand")
, P.map NewLoot (P.s "nouveau-tresor")
]
)
url