diff --git a/exec/Terminal/Main.hs b/app/Main.hs similarity index 59% rename from exec/Terminal/Main.hs rename to app/Main.hs index 664206d..393e740 100644 --- a/exec/Terminal/Main.hs +++ b/app/Main.hs @@ -1,5 +1,5 @@ module Main (main) where -import Controller.Terminal (runGame) +import Controller (runGame) main :: IO () main = runGame \ No newline at end of file diff --git a/battlegrounds.cabal b/battlegrounds.cabal index 63c7014..2c4a538 100644 --- a/battlegrounds.cabal +++ b/battlegrounds.cabal @@ -26,10 +26,10 @@ source-repository head library exposed-modules: Card - Controller.Terminal + Controller Logic Model - View.Terminal + View other-modules: Paths_battlegrounds autogen-modules: @@ -48,20 +48,6 @@ library , uuid ==1.3.15 default-language: Haskell2010 -executable battlegrounds-brick - main-is: Main.hs - other-modules: - Paths_battlegrounds - autogen-modules: - Paths_battlegrounds - hs-source-dirs: - exec/Brick - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N - build-depends: - base >=4.7 && <5 - , battlegrounds - default-language: Haskell2010 - executable battlegrounds-terminal main-is: Main.hs other-modules: @@ -69,7 +55,7 @@ executable battlegrounds-terminal autogen-modules: Paths_battlegrounds hs-source-dirs: - exec/Terminal + app ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.7 && <5 diff --git a/exec/Brick/Main.hs b/exec/Brick/Main.hs deleted file mode 100644 index 22f470a..0000000 --- a/exec/Brick/Main.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Main (main) where - -main :: IO () -main = putStrLn "brick" \ No newline at end of file diff --git a/package.yaml b/package.yaml index b3ba5b2..0ab99f0 100644 --- a/package.yaml +++ b/package.yaml @@ -47,16 +47,7 @@ library: executables: battlegrounds-terminal: main: Main.hs - source-dirs: exec/Terminal - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - battlegrounds - battlegrounds-brick: - main: Main.hs - source-dirs: exec/Brick + source-dirs: app ghc-options: - -threaded - -rtsopts @@ -64,6 +55,7 @@ executables: dependencies: - battlegrounds + tests: battlegrounds-test: main: Spec.hs diff --git a/src/Controller/Terminal.hs b/src/Controller.hs similarity index 97% rename from src/Controller/Terminal.hs rename to src/Controller.hs index bcd7b25..59629ff 100644 --- a/src/Controller/Terminal.hs +++ b/src/Controller.hs @@ -1,4 +1,4 @@ -module Controller.Terminal (module Controller.Terminal) where +module Controller (module Controller) where import Card (bigDumbo) import Control.Lens @@ -10,7 +10,7 @@ import Model (Action (..), CardInstance (CardInstance), GameState (..), Phase (H import Text.Parsec hiding (Error) import Text.Parsec.String (Parser) import Text.Read (readMaybe) -import View.Terminal (render) +import View (render) import Control.Monad.IO.Class (liftIO) import qualified Data.Map as Map diff --git a/src/Logic.hs b/src/Logic.hs index 6eb0715..c167dc1 100644 --- a/src/Logic.hs +++ b/src/Logic.hs @@ -7,7 +7,7 @@ import Card (pool) import Control.Lens ((^.)) import Control.Monad.Random import Model -import View.Terminal (helpMenu) +import View (helpMenu) -- START: Functions interfacing with Action. -- diff --git a/src/Thoughts.md b/src/Thoughts.md new file mode 100644 index 0000000..5569594 --- /dev/null +++ b/src/Thoughts.md @@ -0,0 +1,13 @@ +These are random development thoughts/log. + +### July 31, 2024 +The current repo has too much structure, I think it will be fine to do without the distinction between Terminal/better GUI. + +Claude provided a good roadmap of development: +1. Work out core functionalities and have a single AI. Forget about servers for now. Implement all the logic. +2. Still one main player and a single AI, but manage them through servers. I.e., server now controls the phase timers, and AI has +to issue commands to the server, etc. +3. flush out server stuff, adding game rooms, authentications, etc. + +Note, server and client will be bidirectionally. Server needs to manage phase timers and ping the client when phase changes. +So, the client needs to `forkIO` twice for a sending and receiving thread. The server can have one `fork` per client. \ No newline at end of file diff --git a/src/View/Terminal.hs b/src/View.hs similarity index 99% rename from src/View/Terminal.hs rename to src/View.hs index 68b8a97..0480023 100644 --- a/src/View/Terminal.hs +++ b/src/View.hs @@ -1,4 +1,4 @@ -module View.Terminal (render, helpMenu) where +module View (render, helpMenu) where import Data.List (intercalate) import Data.Map (toList)