Cleanup
This commit is contained in:
@@ -39,7 +39,7 @@ putTerminalFull f col mc tm =
|
||||
defaultSensorWall
|
||||
Nothing
|
||||
)
|
||||
$ \mcpl -> Just $ pt0 (PutWorldUpdate $ const $ over gwWorld $ (setids tmpl btpl mcpl)) (\_ -> f tmpl btpl mcpl)
|
||||
$ \mcpl -> Just $ pt0 (PutWorldUpdate $ const $ over gwWorld (setids tmpl btpl mcpl)) (\_ -> f tmpl btpl mcpl)
|
||||
where
|
||||
setids tmpl btpl mcpl w =
|
||||
w
|
||||
|
||||
@@ -42,16 +42,14 @@ placePlainPSSpot
|
||||
placePlainPSSpot w rm plmnt shift =
|
||||
let (i, w') = placeSpotID rm (shiftPSBy shift (_plSpot plmnt)) (_plType plmnt) w
|
||||
newplmnt = plmnt & plMID ?~ i
|
||||
((gw,rm')) = maybe ((w', rm & rmPmnts .:~ newplmnt))
|
||||
(gw,rm') = maybe (w', rm & rmPmnts .:~ newplmnt)
|
||||
(recrPlace newplmnt w') (_plIDCont plmnt w' newplmnt)
|
||||
in ((f newplmnt gw,rm'))
|
||||
in (f newplmnt gw,rm')
|
||||
where
|
||||
f x gw = fromMaybe gw $ do
|
||||
j <- x ^. plExternalID
|
||||
return $ gw & genPmnt . at j ?~ x
|
||||
recrPlace newplmnt w' pl =
|
||||
let (wr) = placeSpot (w', rm & rmPmnts .:~ newplmnt) pl
|
||||
in (wr)
|
||||
recrPlace newplmnt w' pl = placeSpot (w', rm & rmPmnts .:~ newplmnt) pl
|
||||
|
||||
-- this should be tidied up
|
||||
placeSpotUsingLink ::
|
||||
@@ -65,7 +63,7 @@ placeSpotUsingLink ::
|
||||
placeSpotUsingLink w rm plmnt extract eff fallback = case searchedPoss (_rmPos rm) of
|
||||
Just (ps, rmposs) -> placeSpot (w, eff (head rmposs) $ rm & rmPos .~ rmposs) (plmnt & plSpot .~ ps)
|
||||
Nothing -> case fallback of
|
||||
Nothing -> ((w, rm))
|
||||
Nothing -> (w, rm)
|
||||
Just plmnt' -> placeSpot (w, rm) plmnt'
|
||||
where
|
||||
searchedPoss [] = Nothing
|
||||
|
||||
Reference in New Issue
Block a user