wizard-wipeout/src-client/Client/Types.hs
2023-12-12 11:21:25 +01:00

39 lines
686 B
Haskell

module Client.Types where
import qualified Control.Concurrent.STM as STM
import Control.Monad.RWS
import Data.UUID
import Network.Socket
import Options.Applicative as O
-- internal imports
import Library.Types
newtype Options = Options
{ optSockLoc :: FilePath
}
options :: O.Parser Options
options = Options
<$> argument str
( metavar "FILEPATH"
<> help "Location of the server's socket"
)
data ReaderContainer = ReaderContainer
{ rcSocket :: Socket
, rcClientUUID :: UUID
}
data StateContainer = StateContainer
{ scWizard :: Wizard
, scClientState :: STM.TMVar ClientState
}
type Game = RWST ReaderContainer String StateContainer IO