implemented getPositions

This commit is contained in:
Jonathan Lamothe
2020-02-11 23:37:43 -05:00
parent a80eaa2a40
commit 457298e565
3 changed files with 56 additions and 0 deletions

View File

@@ -23,8 +23,12 @@ module Mtlstats.Helpers.Position
( posSearch
, posSearchExact
, posCallback
, getPositions
) where
import qualified Data.Set as S
import Lens.Micro ((^.))
import Mtlstats.Types
-- | Searches the 'Database' for all the positions used
@@ -57,3 +61,9 @@ posCallback
-> Action ()
-- ^ The action to perform
posCallback = undefined
-- | Extracts a list of positions from a 'Database'
getPositions :: Database -> [String]
getPositions = do
raw <- map (^.pPosition) . (^.dbPlayers)
return $ S.toList $ S.fromList raw