clear rookies on new (regular) season

This commit is contained in:
Jonathan Lamothe
2020-01-11 02:29:17 -05:00
parent fcfbcea72f
commit 3b4ce50ae8
4 changed files with 50 additions and 1 deletions
+7
View File
@@ -24,6 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
module Mtlstats.Actions
( startNewSeason
, resetYtd
, clearRookies
, resetStandings
, startNewGame
, addChar
@@ -61,6 +62,12 @@ resetYtd
= (database . dbPlayers %~ map (pYtd .~ newPlayerStats))
. (database . dbGoalies %~ map (gYtd .~ newGoalieStats))
-- | Clears the rookie flag from all players/goalies
clearRookies :: ProgState -> ProgState
clearRookies = database
%~ (dbPlayers %~ map (pRookie .~ False))
. (dbGoalies %~ map (gRookie .~ False))
-- | Resets game standings
resetStandings :: ProgState -> ProgState
resetStandings = database
+1
View File
@@ -131,6 +131,7 @@ newSeasonMenu :: Menu ()
newSeasonMenu = Menu "*** SEASON TYPE ***" ()
[ MenuItem 'R' "Regular Season" $ modify
$ resetYtd
. clearRookies
. resetStandings
. startNewGame
, MenuItem 'P' "Playoffs" $ modify