added player edit control flow branch
This commit is contained in:
@@ -31,6 +31,7 @@ import Lens.Micro.Extras (view)
|
|||||||
import qualified UI.NCurses as C
|
import qualified UI.NCurses as C
|
||||||
|
|
||||||
import Mtlstats.Actions
|
import Mtlstats.Actions
|
||||||
|
import Mtlstats.Control.EditPlayer
|
||||||
import Mtlstats.Control.GoalieInput
|
import Mtlstats.Control.GoalieInput
|
||||||
import Mtlstats.Format
|
import Mtlstats.Format
|
||||||
import Mtlstats.Handlers
|
import Mtlstats.Handlers
|
||||||
@@ -70,6 +71,7 @@ dispatch s = case s^.progMode of
|
|||||||
| null $ cgs^.cgsNumber -> getGoalieNumC
|
| null $ cgs^.cgsNumber -> getGoalieNumC
|
||||||
| null $ cgs^.cgsName -> getGoalieNameC
|
| null $ cgs^.cgsName -> getGoalieNameC
|
||||||
| otherwise -> confirmCreateGoalieC
|
| otherwise -> confirmCreateGoalieC
|
||||||
|
EditPlayer eps -> editPlayer eps
|
||||||
|
|
||||||
mainMenuC :: Controller
|
mainMenuC :: Controller
|
||||||
mainMenuC = Controller
|
mainMenuC = Controller
|
||||||
|
|||||||
28
src/Mtlstats/Control/EditPlayer.hs
Normal file
28
src/Mtlstats/Control/EditPlayer.hs
Normal file
@@ -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 (..),
|
GameType (..),
|
||||||
CreatePlayerState (..),
|
CreatePlayerState (..),
|
||||||
CreateGoalieState (..),
|
CreateGoalieState (..),
|
||||||
|
EditPlayerState (..),
|
||||||
Database (..),
|
Database (..),
|
||||||
Player (..),
|
Player (..),
|
||||||
PlayerStats (..),
|
PlayerStats (..),
|
||||||
@@ -208,6 +209,7 @@ data ProgMode
|
|||||||
| NewGame GameState
|
| NewGame GameState
|
||||||
| CreatePlayer CreatePlayerState
|
| CreatePlayer CreatePlayerState
|
||||||
| CreateGoalie CreateGoalieState
|
| CreateGoalie CreateGoalieState
|
||||||
|
| EditPlayer EditPlayerState
|
||||||
|
|
||||||
instance Show ProgMode where
|
instance Show ProgMode where
|
||||||
show MainMenu = "MainMenu"
|
show MainMenu = "MainMenu"
|
||||||
@@ -298,6 +300,9 @@ data CreateGoalieState = CreateGoalieState
|
|||||||
-- ^ The function to call on failure
|
-- ^ The function to call on failure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- | Player edit status
|
||||||
|
data EditPlayerState = EditPlayerState
|
||||||
|
|
||||||
-- | Represents the database
|
-- | Represents the database
|
||||||
data Database = Database
|
data Database = Database
|
||||||
{ _dbPlayers :: [Player]
|
{ _dbPlayers :: [Player]
|
||||||
|
|||||||
Reference in New Issue
Block a user