extracts Chest module, pulling out Route and Utils
This commit is contained in:
25
src/Route.elm
Normal file
25
src/Route.elm
Normal 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
|
||||
Reference in New Issue
Block a user