player selection branch
This commit is contained in:
parent
43c2f6191d
commit
b19f1386ec
|
@ -21,8 +21,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
|
||||
module Mtlstats.Control.EditPlayer (editPlayer) where
|
||||
|
||||
import Lens.Micro ((^.))
|
||||
|
||||
import Mtlstats.Types
|
||||
|
||||
-- | Dispatcher/controller for the player edit mode
|
||||
editPlayer :: EditPlayerState -> Controller
|
||||
editPlayer = undefined
|
||||
editPlayer eps
|
||||
| null $ eps^.epsSelectedPlayer = selectPlayerC
|
||||
| otherwise = undefined
|
||||
|
||||
selectPlayerC :: Controller
|
||||
selectPlayerC = undefined
|
||||
|
|
|
@ -83,6 +83,8 @@ module Mtlstats.Types (
|
|||
cgsName,
|
||||
cgsSuccessCallback,
|
||||
cgsFailureCallback,
|
||||
-- ** EditPlayerState Lenses
|
||||
epsSelectedPlayer,
|
||||
-- ** Database Lenses
|
||||
dbPlayers,
|
||||
dbGoalies,
|
||||
|
@ -122,6 +124,7 @@ module Mtlstats.Types (
|
|||
newGameState,
|
||||
newCreatePlayerState,
|
||||
newCreateGoalieState,
|
||||
newEditPlayerState,
|
||||
newDatabase,
|
||||
newPlayer,
|
||||
newPlayerStats,
|
||||
|
@ -301,7 +304,10 @@ data CreateGoalieState = CreateGoalieState
|
|||
}
|
||||
|
||||
-- | Player edit status
|
||||
data EditPlayerState = EditPlayerState
|
||||
newtype EditPlayerState = EditPlayerState
|
||||
{ _epsSelectedPlayer :: Maybe Int
|
||||
-- ^ The index number of the player being edited
|
||||
}
|
||||
|
||||
-- | Represents the database
|
||||
data Database = Database
|
||||
|
@ -549,6 +555,7 @@ makeLenses ''ProgState
|
|||
makeLenses ''GameState
|
||||
makeLenses ''CreatePlayerState
|
||||
makeLenses ''CreateGoalieState
|
||||
makeLenses ''EditPlayerState
|
||||
makeLenses ''Database
|
||||
makeLenses ''Player
|
||||
makeLenses ''PlayerStats
|
||||
|
@ -631,6 +638,12 @@ newCreateGoalieState = CreateGoalieState
|
|||
, _cgsFailureCallback = return ()
|
||||
}
|
||||
|
||||
-- | Constructor for an 'EditPlayerState'
|
||||
newEditPlayerState :: EditPlayerState
|
||||
newEditPlayerState = EditPlayerState
|
||||
{ _epsSelectedPlayer = Nothing
|
||||
}
|
||||
|
||||
-- | Constructor for a 'Database'
|
||||
newDatabase :: Database
|
||||
newDatabase = Database
|
||||
|
|
Loading…
Reference in New Issue
Block a user