{-# LANGUAGE RecordWildCards #-}

module Mobs where

import Types
import Data.Aeson
import Graphics.Vty
import Linear
import qualified Data.Map as M

type MobMap = M.Map String (V2 Int -> Mob)

data MobTemplate = MobTemplate {
      templateChar :: Char
    , templateAttr :: Attr
    , templateIdName :: String
    } deriving (Eq,Show)

makeMob :: MobTemplate -> V2 Int -> Mob
makeMob MobTemplate{..} v = Mob v templateChar templateAttr

makeMobMap :: [MobTemplate] -> M.Map String (V2 Int -> Mob)
makeMobMap = M.fromList . map helper
    where helper x = (templateIdName x, makeMob x)



