wizard-wipeout/src-client/Client/Types.hs

40 lines
761 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
, rcQueue :: STM.TQueue ServerMessage
}
data StateContainer = StateContainer
{ scWizard :: Wizard
, scClientState :: STM.TMVar ClientState
, scMapSlice :: MapSlice
}
type Game = RWST ReaderContainer String StateContainer IO