From 03679ef1fa9ce6109b66af9ba3a2e32aa7c369de Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 10 Dec 2023 15:18:40 +0100 Subject: [PATCH] prepare for actual data --- src-client/Client/Types.hs | 21 +++++++++++++++++++++ wizard-wipeout.cabal | 3 +++ 2 files changed, 24 insertions(+) diff --git a/src-client/Client/Types.hs b/src-client/Client/Types.hs index 3fa9792..0b99fed 100644 --- a/src-client/Client/Types.hs +++ b/src-client/Client/Types.hs @@ -1,7 +1,17 @@ module Client.Types where +import Control.Monad.RWS + +import Data.UUID + import Options.Applicative as O +import System.IO + +-- internal imports + +import Library.Types + newtype Options = Options { optSockLoc :: FilePath } @@ -12,3 +22,14 @@ options = Options ( metavar "FILEPATH" <> help "Location of the server's socket" ) + +data ReaderContainer = ReaderContainer + { rcSocketHandle :: Handle + , rcClientUUID :: UUID + } + +newtype StateContainer = StateContainer + { scWizard :: Wizard + } + +type Game = RWST ReaderContainer String StateContainer IO diff --git a/wizard-wipeout.cabal b/wizard-wipeout.cabal index c87f8d3..8016df4 100644 --- a/wizard-wipeout.cabal +++ b/wizard-wipeout.cabal @@ -19,7 +19,9 @@ common warnings library import: warnings exposed-modules: Library.Types + Library.Types.Communication build-depends: base ^>=4.17.2.1 + , aeson , linear , matrix , random @@ -38,6 +40,7 @@ executable wizard-wipeout-client , mtl , network , optparse-applicative + , uuid , vty , wizard-wipeout hs-source-dirs: src-client