added player edit control flow branch
This commit is contained in:
parent
6ec7566b2c
commit
43c2f6191d
|
@ -31,6 +31,7 @@ import Lens.Micro.Extras (view)
|
|||
import qualified UI.NCurses as C
|
||||
|
||||
import Mtlstats.Actions
|
||||
import Mtlstats.Control.EditPlayer
|
||||
import Mtlstats.Control.GoalieInput
|
||||
import Mtlstats.Format
|
||||
import Mtlstats.Handlers
|
||||
|
@ -70,6 +71,7 @@ dispatch s = case s^.progMode of
|
|||
| null $ cgs^.cgsNumber -> getGoalieNumC
|
||||
| null $ cgs^.cgsName -> getGoalieNameC
|
||||
| otherwise -> confirmCreateGoalieC
|
||||
EditPlayer eps -> editPlayer eps
|
||||
|
||||
mainMenuC :: Controller
|
||||
mainMenuC = Controller
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
{- |
|
||||
|
||||
mtlstats
|
||||
Copyright (C) 2019 Rhéal Lamothe
|
||||
<rheal.lamothe@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or (at
|
||||
your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
-}
|
||||
|
||||
module Mtlstats.Control.EditPlayer (editPlayer) where
|
||||
|
||||
import Mtlstats.Types
|
||||
|
||||
-- | Dispatcher/controller for the player edit mode
|
||||
editPlayer :: EditPlayerState -> Controller
|
||||
editPlayer = undefined
|
|
@ -31,6 +31,7 @@ module Mtlstats.Types (
|
|||
GameType (..),
|
||||
CreatePlayerState (..),
|
||||
CreateGoalieState (..),
|
||||
EditPlayerState (..),
|
||||
Database (..),
|
||||
Player (..),
|
||||
PlayerStats (..),
|
||||
|
@ -208,6 +209,7 @@ data ProgMode
|
|||
| NewGame GameState
|
||||
| CreatePlayer CreatePlayerState
|
||||
| CreateGoalie CreateGoalieState
|
||||
| EditPlayer EditPlayerState
|
||||
|
||||
instance Show ProgMode where
|
||||
show MainMenu = "MainMenu"
|
||||
|
@ -298,6 +300,9 @@ data CreateGoalieState = CreateGoalieState
|
|||
-- ^ The function to call on failure
|
||||
}
|
||||
|
||||
-- | Player edit status
|
||||
data EditPlayerState = EditPlayerState
|
||||
|
||||
-- | Represents the database
|
||||
data Database = Database
|
||||
{ _dbPlayers :: [Player]
|
||||
|
|
Loading…
Reference in New Issue
Block a user