Skip to content

Commit

Permalink
removed unnecessary moduling
Browse files Browse the repository at this point in the history
  • Loading branch information
flober committed Aug 1, 2024
1 parent ad8bf1d commit 8ee71dd
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 36 deletions.
2 changes: 1 addition & 1 deletion exec/Terminal/Main.hs → app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Main (main) where
import Controller.Terminal (runGame)
import Controller (runGame)

main :: IO ()
main = runGame
20 changes: 3 additions & 17 deletions battlegrounds.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -48,28 +48,14 @@ 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:
Paths_battlegrounds
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
Expand Down
4 changes: 0 additions & 4 deletions exec/Brick/Main.hs

This file was deleted.

12 changes: 2 additions & 10 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,15 @@ 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
- -with-rtsopts=-N
dependencies:
- battlegrounds


tests:
battlegrounds-test:
main: Spec.hs
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Terminal.hs → src/Controller.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Controller.Terminal (module Controller.Terminal) where
module Controller (module Controller) where

import Card (bigDumbo)
import Control.Lens
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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. --

Expand Down
13 changes: 13 additions & 0 deletions src/Thoughts.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/View/Terminal.hs → src/View.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module View.Terminal (render, helpMenu) where
module View (render, helpMenu) where

import Data.List (intercalate)
import Data.Map (toList)
Expand Down

0 comments on commit 8ee71dd

Please sign in to comment.