about summary refs log tree commit diff
path: root/src/Xanthous/App.hs
blob: 5c0383c38e196d4ba38fc741ecfaa4a1375bdd2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Xanthous.App (makeApp) where

import Xanthous.Prelude
import Brick hiding (App)
import qualified Brick
import Graphics.Vty.Attributes (defAttr)

import Xanthous.Game
import Xanthous.Game.Draw (drawGame)
import Xanthous.Resource (Name)

type App = Brick.App GameState () Name

makeApp :: IO App
makeApp = pure $ Brick.App
  { appDraw = drawGame
  , appChooseCursor = const headMay
  , appHandleEvent = resizeOrQuit
  , appStartEvent = pure
  , appAttrMap = const $ attrMap defAttr []
  }