From 1eae6ae381b2f25f919cb405e1bca8f184c15f2a Mon Sep 17 00:00:00 2001 From: nek0 Date: Mon, 7 Dec 2020 16:03:16 +0100 Subject: [PATCH] fix haddock markup --- src/Map.hs | 2 +- src/Types/GameMap.hs | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Map.hs b/src/Map.hs index 04c1b63..5cc53e1 100644 --- a/src/Map.hs +++ b/src/Map.hs @@ -36,7 +36,7 @@ constructMap desc tilemapSlot = do <*> pure (V2 (fst $ levelStartPos desc) (snd $ levelStartPos desc)) readLayer - :: (Word, FilePath) -- | index and path of the layer descriptor image + :: (Word, FilePath) -- ^ index and path of the layer descriptor image -> IO (MapLayer, V2 Int) readLayer (idx, path) = do img <- either error convertRGBA8 <$> readImage path diff --git a/src/Types/GameMap.hs b/src/Types/GameMap.hs index d10a2f2..fb1f90e 100644 --- a/src/Types/GameMap.hs +++ b/src/Types/GameMap.hs @@ -9,22 +9,22 @@ import Linear import Types.Texture data LevelMap = LevelMap - { mapLayers :: Vector MapLayer -- | Layer stack - , mapWalkLayer :: Word -- | Collision layer index in stack - , mapDimensions :: V2 Word -- | Dimension of map in tiles - , mapTileMap :: TileMap -- | The tile map - , mapStartPos :: V2 Word -- | Player start position + { mapLayers :: Vector MapLayer -- ^ Layer stack + , mapWalkLayer :: Word -- ^ Collision layer index in stack + , mapDimensions :: V2 Word -- ^ Dimension of map in tiles + , mapTileMap :: TileMap -- ^ The tile map + , mapStartPos :: V2 Word -- ^ Player start position } deriving (Eq, Show) newtype MapLayer = MapLayer - { layerTiles :: Vector Tile -- | Tiles of this layer + { layerTiles :: Vector Tile -- ^ Tiles of this layer } deriving (Eq, Show) data Tile = Tile - { tileOffset :: V2 Word -- | Offset of this tile on the tile map - , tileType :: TileType -- | Type of tile + { tileOffset :: V2 Word -- ^ Offset of this tile on the tile map + , tileType :: TileType -- ^ Type of tile } deriving (Eq, Show) @@ -35,16 +35,16 @@ data TileType deriving (Enum, Ord, Eq, Show) data TileMap = TileMap - { tileMapDimensions :: V2 Word -- | Dimensions of tile map image in pixels - , tileMapTexture :: Texture -- | Texture object on GPU + { tileMapDimensions :: V2 Word -- ^ Dimensions of tile map image in pixels + , tileMapTexture :: Texture -- ^ Texture object on GPU } deriving (Eq, Show) data LevelDescriptor = LevelDescriptor - { levelLayerPath :: [(Word, FilePath)] -- | Indexed paths to the layers - , levelWalkLayer :: Word -- | Index of walk layer - , levelTileMap :: FilePath -- | Filepath to tile map - , levelStartPos :: (Word, Word) -- | Player start position + { levelLayerPath :: [(Word, FilePath)] -- ^ Indexed paths to the layers + , levelWalkLayer :: Word -- ^ Index of walk layer + , levelTileMap :: FilePath -- ^ Filepath to tile map + , levelStartPos :: (Word, Word) -- ^ Player start position -- , levelCollectibles :: [(V2 Word, ())] -- | TODO; Collectibles and their tile coords -- , levelEnemies :: [(V2 Word, ())] -- | TODO: Enemies and their tile coords -- , levelInteractables :: [(V2 Word, ())] -- | TODO: Interactables and their coords