{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE StrictData #-} module Dodge.LevelGen.Data where import Dodge.Data import Picture import Control.Lens import Control.Monad.State import System.Random data PSType = PutCrit {_unPutCrit :: Creature} | PutLS LightSource Picture | PutButton Button | PutFlIt Item | PutPressPlate PressPlate | PutAutoDoor Point2 Point2 | PutBlock [Int] Color [Point2] | PutLineBlock Wall Float Float Point2 Point2 | PutWall { _pwPoly :: [Point2] , _pwWall :: Wall } | PutDoubleDoor Color (World -> Bool) Point2 Point2 | PutDoor Color (World -> Bool) [(Point2,Point2)] | PutBtDoor Color Point2 Float Point2 Point2 | PutSwitchDoor Color Point2 Float Point2 Point2 | RandPS (State StdGen PSType) | PutNothing | PutID { _putID :: Int} data PlacementSpot = PS { _psPos :: Point2 , _psRot :: Float , _psType :: PSType } data Placement = SinglePlacement {_placementSpot :: PlacementSpot } | GroupedPlacement {_groupPlacementID :: Int -- ,_groupPlacementUpdate :: World -> Placement -> (World, Placement) ,_groupUpdate :: World -> [Placement] -> World -- ,_groupPlacementFunc :: [PSType] -> PSType -> World -> World ,_placementSpot :: PlacementSpot } sPS :: Point2 -> Float -> PSType -> Placement sPS p a = SinglePlacement . PS p a makeLenses ''PSType makeLenses ''PlacementSpot makeLenses ''Placement