module Dodge.Wire where
--import Dodge.LevelGen.Data
import Dodge.Default.Foreground
import Dodge.Data
import Geometry
import LensHelp
import ShapePicture
import Shape
import Color
import Dodge.Room.Foreground

import qualified Data.IntMap.Strict as IM

floorWire :: Point2 -> Point2 -> ForegroundShape
floorWire a b = defaultForeground
    & fsPos .~ m
    & fsRad .~ dist m a
    & fsSPic .~ noPic (colorSH yellow $ thinHighBar 0 a' b')
  where
    m = midPoint a b
    a' = a - m
    b' = b - m
verticalWire :: Point2 -> Float -> Float -> ForegroundShape
verticalWire p h1 h2 = defaultForeground
    & fsPos .~ p
    & fsRad .~ 2
    & fsSPic .~ noPic (colorSH yellow $ barPP 1.5 (V3 0 0 h1) (V3 0 0 h2))

putWireEnd :: Int -> (Point2,Float) -> Float -> Room -> Room
putWireEnd i (p,a) h = rmEndWires %~ IM.insert i (WallWire p a h)

putWireStart :: Int -> (Point2,Float) -> Float -> Room -> Room
putWireStart i (p,a) h = rmStartWires %~ IM.insert i (WallWire p a h)
