Refactor creature draw, pass World to function

This commit is contained in:
2021-05-25 21:44:25 +02:00
parent 28386ec8b9
commit d4a15a2416
10 changed files with 48 additions and 37 deletions
+6 -1
View File
@@ -4,6 +4,7 @@ Takes into account damage etc. -}
module Dodge.Creature.Picture
( basicCrPict
, circLine
, picAtCrPos
) where
import Dodge.Data
--import Dodge.Creature.Stance.Data
@@ -19,8 +20,9 @@ import qualified Data.IntMap.Strict as IM
basicCrPict
:: Color -- ^ Creature color
-> Creature
-> World
-> Picture
basicCrPict col cr = pictures
basicCrPict col cr _ = uncurry translate (_crPos cr) $ rotate (_crDir cr) $ pictures
[ onLayer CrLayer . piercingMod $ bluntScale naked
-- , drawAwakeLevel cr
, drawEquipment cr
@@ -72,3 +74,6 @@ drawEquipment cr = pictures $ map f $ IM.toList (_crInv cr)
circLine :: Float -> Picture
circLine x = line [(0,0),(x,0)]
picAtCrPos :: Picture -> Creature -> World -> Picture
picAtCrPos thePic cr _ = uncurry translate (_crPos cr) $ rotate (_crDir cr) thePic