Start to remove explicit "outplacements"
This commit is contained in:
@@ -76,8 +76,8 @@ divideDoorPane mid wl cond soff speed ppairs g = case ppairs of
|
||||
& drPushedBy .~ maybe PushesItself PushedBy mid
|
||||
|
||||
putAutoDoor :: Point2 -> Point2 -> Placement
|
||||
putAutoDoor a b = Placement (PS 0 0) (PutCoord a) Nothing $ \_ apl ->
|
||||
Just $ Placement (PS 0 0) (PutCoord b) Nothing $ \w bpl ->
|
||||
putAutoDoor a b = Placement (PS 0 0) (PutCoord a) Nothing Nothing $ \_ apl ->
|
||||
Just $ Placement (PS 0 0) (PutCoord b) Nothing Nothing $ \w bpl ->
|
||||
let x = w ^?! gwWorld . coordinates . ix (apl ^?! plMID . _Just)
|
||||
y = w ^?! gwWorld . coordinates . ix (bpl ^?! plMID . _Just)
|
||||
in Just $ putDoubleDoor
|
||||
|
||||
@@ -174,7 +174,7 @@ spanLSLightI ls h a b =
|
||||
|
||||
spanLS :: LightSource -> Point2 -> Point2 -> Placement
|
||||
spanLS ls a b =
|
||||
Placement (PS (V2 x y) 0) (PutLS ls) Nothing $
|
||||
Placement (PS (V2 x y) 0) (PutLS ls) Nothing Nothing $
|
||||
const $ const $ Just $ sps0 $ putShape $ thinHighBar h a b
|
||||
where
|
||||
V3 _ _ h = _lsPos (_lsParam ls) + 5
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
-}
|
||||
module Dodge.Placement.PlaceSpot (placeSpot) where
|
||||
|
||||
import Data.Maybe
|
||||
import Color
|
||||
import Control.Monad.State
|
||||
import Data.Bifunctor
|
||||
@@ -41,9 +42,13 @@ placePlainPSSpot
|
||||
placePlainPSSpot w rm plmnt shift =
|
||||
let (i, w') = placeSpotID rm (shiftPSBy shift (_plSpot plmnt)) (_plType plmnt) w
|
||||
newplmnt = plmnt & plMID ?~ i
|
||||
in maybe ((w', rm & rmPmnts .:~ newplmnt), [newplmnt])
|
||||
((gw,rm'),plist) = maybe ((w', rm & rmPmnts .:~ newplmnt), [newplmnt])
|
||||
(recrPlace newplmnt w') (_plIDCont plmnt w' newplmnt)
|
||||
in ((f newplmnt gw,rm'),plist)
|
||||
where
|
||||
f x gw = fromMaybe gw $ do
|
||||
j <- x ^. plExternalID
|
||||
return $ gw & genPmnt . at j ?~ [x]
|
||||
recrPlace newplmnt w' pl =
|
||||
let (wr, newplmnts) = placeSpot (w', rm & rmPmnts .:~ newplmnt) pl
|
||||
in (wr, newplmnt : newplmnts)
|
||||
|
||||
Reference in New Issue
Block a user