about summary refs log tree commit diff
path: root/src/Xanthous/Entities/Character.hs
blob: 246e55071cb843915a68e8722996171b680ec50a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module Xanthous.Entities.Character
  ( Character(..)
  , mkCharacter
  ) where
--------------------------------------------------------------------------------
import Xanthous.Prelude
import Test.QuickCheck
import Brick
--------------------------------------------------------------------------------
import Xanthous.Entities
--------------------------------------------------------------------------------

data Character = Character
  deriving stock (Show, Eq, Ord, Generic)
  deriving anyclass (CoArbitrary, Function)

scrollOffset :: Int
scrollOffset = 5

-- deriving Draw via (DrawCharacter "@" Character)
instance Draw Character where
  draw _ = visibleRegion rloc rreg $ str "@"
    where
      rloc = Location (negate scrollOffset, negate scrollOffset)
      rreg = (2 * scrollOffset, 2 * scrollOffset)

instance Entity Character where
  blocksVision _ = False

instance Arbitrary Character where
  arbitrary = pure Character

mkCharacter :: Character
mkCharacter = Character