blob: e64a6506f3a1b160dd7c3605e5da6d7562ff0a37 (
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
|
module Fallen.Tiles
( Tile(Grass, Earth, Passage, Floor, Forest, Rock, Water),
drawTile,
passableTiles
) where
import UI.HSCurses.CursesHelper
data Tile = Grass | Earth | Passage | Floor | Forest | Rock | Water deriving (Show)
instance Eq Tile where
Grass == Grass = True
Earth == Earth = True
Passage == Passage = True
Floor == Floor = True
Forest == Forest = True
Rock == Rock = True
Water == Water = True
_ == _ = False
drawCharWithColor ch color = toEnum $ fromEnum ch
drawTile Grass = drawCharWithColor '.' GreenF
drawTile Earth = drawCharWithColor ' ' BlackF
drawTile Passage = drawCharWithColor '.' GreyF
drawTile Floor = drawCharWithColor '.' GreyF
drawTile Forest = drawCharWithColor '~' GreenF
drawTile Rock = drawCharWithColor '*' GreyF
drawTile Water = drawCharWithColor '~' BlueF
passableTiles = [Grass, Passage, Floor]
|