Add file
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
{-# LANGUAGE StrictData #-}
|
||||||
|
module Dodge.LevelGen.LevelStructure where
|
||||||
|
import Dodge.LevelGen.Data
|
||||||
|
--import Dodge.Tree.Compose.Data
|
||||||
|
import Dodge.Data
|
||||||
|
|
||||||
|
--import Data.Tree
|
||||||
|
import qualified Data.IntMap.Strict as IM
|
||||||
|
--import System.Random
|
||||||
|
|
||||||
|
data GenWorld = GenWorld
|
||||||
|
{ _gWorld :: World
|
||||||
|
, _gPlacements :: IM.IntMap [Placement]
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
module Dodge.Placement.Shift
|
||||||
|
( shiftPlacement
|
||||||
|
, shiftPSBy
|
||||||
|
) where
|
||||||
|
import Dodge.LevelGen.Data
|
||||||
|
import Dodge.ShiftPoint
|
||||||
|
import Geometry
|
||||||
|
import Control.Lens
|
||||||
|
shiftPSBy :: (Point2,Float) -> PlacementSpot -> PlacementSpot
|
||||||
|
shiftPSBy (pos,rot) ps = ps
|
||||||
|
& psPos %~ shiftPointBy (pos,rot)
|
||||||
|
& psRot %~ (+ rot)
|
||||||
|
shiftPlacement :: (Point2,Float) -> Placement -> Placement
|
||||||
|
shiftPlacement shift plmnt = case plmnt of
|
||||||
|
Placement {} -> plmnt & plSpot %~ shiftPSBy shift
|
||||||
|
& plIDCont %~ fmap (fmap $ shiftPlacement shift)
|
||||||
|
PlacementUsingPos p f -> PlacementUsingPos (shiftPoint3By shift p)
|
||||||
|
(fmap (shiftPlacement shift) f)
|
||||||
|
RandomPlacement rpl -> RandomPlacement $ fmap (shiftPlacement shift) rpl
|
||||||
Reference in New Issue
Block a user