implemented confirmCreateGoalieC
This commit is contained in:
parent
ed31ce5b1d
commit
2d2ee61aae
|
@ -33,6 +33,7 @@ module Mtlstats.Actions
|
||||||
, createPlayer
|
, createPlayer
|
||||||
, createGoalie
|
, createGoalie
|
||||||
, addPlayer
|
, addPlayer
|
||||||
|
, addGoalie
|
||||||
, recordGoalAssists
|
, recordGoalAssists
|
||||||
, awardGoal
|
, awardGoal
|
||||||
, awardAssist
|
, awardAssist
|
||||||
|
@ -167,6 +168,10 @@ addPlayer s = fromMaybe s $ do
|
||||||
Just $ s & database.dbPlayers
|
Just $ s & database.dbPlayers
|
||||||
%~ (++[player])
|
%~ (++[player])
|
||||||
|
|
||||||
|
-- | Adds the entered goalie to the roster
|
||||||
|
addGoalie :: ProgState -> ProgState
|
||||||
|
addGoalie = undefined
|
||||||
|
|
||||||
-- | Awards the goal and assists to the players
|
-- | Awards the goal and assists to the players
|
||||||
recordGoalAssists :: ProgState -> ProgState
|
recordGoalAssists :: ProgState -> ProgState
|
||||||
recordGoalAssists ps = fromMaybe ps $ do
|
recordGoalAssists ps = fromMaybe ps $ do
|
||||||
|
|
|
@ -357,7 +357,26 @@ getGoalieNameC = Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
confirmCreateGoalieC :: Controller
|
confirmCreateGoalieC :: Controller
|
||||||
confirmCreateGoalieC = undefined
|
confirmCreateGoalieC = Controller
|
||||||
|
{ drawController = \s -> do
|
||||||
|
let cgs = s^.progMode.createGoalieStateL
|
||||||
|
C.drawString $ unlines
|
||||||
|
[ "Goalie number: " ++ show (fromJust $ cgs^.cgsNumber)
|
||||||
|
, " Goalie name: " ++ cgs^.cgsName
|
||||||
|
, ""
|
||||||
|
, "Create goalie: are you sure? (Y/N)"
|
||||||
|
]
|
||||||
|
return C.CursorInvisible
|
||||||
|
, handleController = \e -> do
|
||||||
|
case ynHandler e of
|
||||||
|
Just True -> do
|
||||||
|
modify addGoalie
|
||||||
|
join $ gets (^.progMode.createGoalieStateL.cgsSuccessCallback)
|
||||||
|
Just False ->
|
||||||
|
join $ gets (^.progMode.createGoalieStateL.cgsFailureCallback)
|
||||||
|
Nothing -> return ()
|
||||||
|
return True
|
||||||
|
}
|
||||||
|
|
||||||
gameGoal :: ProgState -> (Int, Int)
|
gameGoal :: ProgState -> (Int, Int)
|
||||||
gameGoal s =
|
gameGoal s =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user