starts cleaning up a bit
This commit is contained in:
21
src/Main.elm
21
src/Main.elm
@@ -13,6 +13,8 @@ import Json.Decode exposing (Decoder, field, list, string, int, succeed)
|
||||
import Json.Encode as E
|
||||
import Url.Parser as P exposing (Parser, (</>), oneOf, s)
|
||||
import Set exposing (Set)
|
||||
|
||||
|
||||
-- Main
|
||||
|
||||
main : Program () Model Msg
|
||||
@@ -58,17 +60,28 @@ init flags url key =
|
||||
Just r -> r
|
||||
Nothing -> PlayerChest
|
||||
in
|
||||
( Model (State key route "" False Nothing Nothing) blankPlayer [] Nothing Nothing Nothing Nothing, fetchInitialData 0)
|
||||
( Model
|
||||
(State key route "" False Nothing Nothing)
|
||||
blankPlayer
|
||||
[]
|
||||
Nothing
|
||||
Nothing
|
||||
Nothing
|
||||
Nothing
|
||||
, fetchInitialData 0)
|
||||
|
||||
|
||||
fetchInitialData : Int -> Cmd Msg
|
||||
fetchInitialData playerId =
|
||||
Cmd.batch [ initPlayer playerId
|
||||
Cmd.batch
|
||||
[ initPlayer playerId
|
||||
, fetchShopInventory
|
||||
, fetchGroupLoot
|
||||
]
|
||||
|
||||
---
|
||||
-- PLAYER
|
||||
--
|
||||
---
|
||||
type alias Player =
|
||||
{ id: Int
|
||||
, name: String
|
||||
@@ -77,7 +90,7 @@ type alias Player =
|
||||
}
|
||||
|
||||
blankPlayer =
|
||||
Player 0 "Loading" 0 (Wealth 0 0 0 0)
|
||||
Player 0 "Loot-a-lot" 0 (Wealth 0 0 0 0)
|
||||
|
||||
initPlayer id =
|
||||
Cmd.batch [fetchPlayer id, fetchLoot id, fetchClaims id]
|
||||
|
||||
3
tmux.sh
3
tmux.sh
@@ -2,6 +2,7 @@
|
||||
|
||||
tmux new-session -d -s elm
|
||||
tmux split-window -v "elm reactor --port 8080"
|
||||
tmux split-window -h -c $HOME/Projets/rust/lootalot "cargo run"
|
||||
tmux split-window -v -c $HOME/Projets/rust/lootalot "cargo run"
|
||||
tmux select-pane -U
|
||||
tmux select-pane -U
|
||||
tmux attach-session -t elm
|
||||
|
||||
Reference in New Issue
Block a user