implemented new season handler
This commit is contained in:
parent
76b4b85a0f
commit
27761d2b87
|
@ -19,7 +19,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module Mtlstats.Actions (startNewSeason, startNewGame) where
|
module Mtlstats.Actions
|
||||||
|
( startNewSeason
|
||||||
|
, resetYtd
|
||||||
|
, startNewGame
|
||||||
|
) where
|
||||||
|
|
||||||
import Lens.Micro ((.~))
|
import Lens.Micro ((.~))
|
||||||
|
|
||||||
|
@ -29,6 +33,10 @@ import Mtlstats.Types
|
||||||
startNewSeason :: ProgState -> ProgState
|
startNewSeason :: ProgState -> ProgState
|
||||||
startNewSeason = (progMode .~ NewSeason) . (database . dbGames .~ 0)
|
startNewSeason = (progMode .~ NewSeason) . (database . dbGames .~ 0)
|
||||||
|
|
||||||
|
-- | Resets all players year-to-date stats
|
||||||
|
resetYtd :: ProgState -> ProgState
|
||||||
|
resetYtd = undefined
|
||||||
|
|
||||||
-- | Starts a new game
|
-- | Starts a new game
|
||||||
startNewGame :: ProgState -> ProgState
|
startNewGame :: ProgState -> ProgState
|
||||||
startNewGame = undefined
|
startNewGame = undefined
|
||||||
|
|
|
@ -50,7 +50,11 @@ mainMenu (C.EventCharacter c) = case c of
|
||||||
mainMenu _ = return True
|
mainMenu _ = return True
|
||||||
|
|
||||||
newSeason :: C.Event -> StateT ProgState C.Curses ()
|
newSeason :: C.Event -> StateT ProgState C.Curses ()
|
||||||
newSeason = undefined
|
newSeason (C.EventCharacter c) = case c of
|
||||||
|
'1' -> modify $ resetYtd . startNewGame
|
||||||
|
'2' -> modify startNewGame
|
||||||
|
_ -> return ()
|
||||||
|
newSeason _ = return ()
|
||||||
|
|
||||||
newGame :: C.Event -> StateT ProgState C.Curses ()
|
newGame :: C.Event -> StateT ProgState C.Curses ()
|
||||||
newGame = undefined
|
newGame = undefined
|
||||||
|
|
Loading…
Reference in New Issue
Block a user