~vonfry/maze-escape

3bebf845c649fae8a286f6a0cc7caf816fb3ba88 — Vonfry 2 years ago d7df05b
data/type: use type for pos
1 files changed, 3 insertions(+), 2 deletions(-)

M lib/Game/Maze/Data.hs
M lib/Game/Maze/Data.hs => lib/Game/Maze/Data.hs +3 -2
@@ 1,4 1,5 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}

module Game.Maze.Data where



@@ 12,7 13,7 @@ data MazeCell = S -- ^ source

newtype MazeMapList pos cell = MazeMapList [[cell]]

newtype MazeMapListPos = MazeMapListPos (Int, Int)
type MazeMapListPos = (Int, Int)

instance MovableCell MazeCell where
  movable X = False


@@ 21,7 22,7 @@ instance MovableCell MazeCell where
instance Maze2D MazeMapList MazeMapListPos MazeCell where
  adjacence map pos = [] -- TODO

  getCell (MazeMapList cells) (MazeMapListPos (x,y)) = cells !! x !! y
  getCell (MazeMapList cells) (x,y) = cells !! x !! y

  source = flip findCellEq S