clear rookies on new (regular) season
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -131,6 +131,7 @@ newSeasonMenu :: Menu ()
|
||||
newSeasonMenu = Menu "*** SEASON TYPE ***" ()
|
||||
[ MenuItem 'R' "Regular Season" $ modify
|
||||
$ resetYtd
|
||||
. clearRookies
|
||||
. resetStandings
|
||||
. startNewGame
|
||||
, MenuItem 'P' "Playoffs" $ modify
|
||||
|
||||
Reference in New Issue
Block a user