Cleanup
This commit is contained in:
@@ -15,18 +15,16 @@ import Geometry
|
||||
import Linear
|
||||
|
||||
putDoubleDoor ::
|
||||
Bool ->
|
||||
Wall ->
|
||||
WdBl ->
|
||||
Point2 ->
|
||||
Point2 ->
|
||||
Float ->
|
||||
Placement
|
||||
putDoubleDoor isauto wl cond a b speed =
|
||||
putDoubleDoorThen isauto wl cond 1 a b speed (const $ const Nothing)
|
||||
putDoubleDoor wl cond a b speed =
|
||||
putDoubleDoorThen wl cond 1 a b speed (const $ const Nothing)
|
||||
|
||||
putDoubleDoorThen ::
|
||||
Bool ->
|
||||
Wall ->
|
||||
WdBl ->
|
||||
Float ->
|
||||
@@ -35,16 +33,15 @@ putDoubleDoorThen ::
|
||||
Float ->
|
||||
(Placement -> Placement -> Maybe Placement) ->
|
||||
Placement
|
||||
putDoubleDoorThen isauto wl cond soff a b speed cont =
|
||||
doorBetween isauto wl cond soff a half speed $
|
||||
putDoubleDoorThen wl cond soff a b speed cont =
|
||||
doorBetween wl cond soff a half speed $
|
||||
\pl1 -> Just $
|
||||
doorBetween isauto wl cond soff b half speed $
|
||||
doorBetween wl cond soff b half speed $
|
||||
\pl2 -> cont pl1 pl2
|
||||
where
|
||||
half = 0.5 *.* (a +.+ b)
|
||||
|
||||
doorBetween ::
|
||||
Bool ->
|
||||
Wall ->
|
||||
WdBl ->
|
||||
Float ->
|
||||
@@ -53,9 +50,9 @@ doorBetween ::
|
||||
Float ->
|
||||
(Placement -> Maybe Placement) ->
|
||||
Placement
|
||||
doorBetween isauto wl cond soff pa pb speed g = case divideLine 40 pa pb of
|
||||
doorBetween wl cond soff pa pb speed g = case divideLine 40 pa pb of
|
||||
[x, y] -> ptCont (putSlideDr adoor wl soff x y) g
|
||||
(x : y : zs) -> divideDoorPane isauto Nothing wl cond (soff - dist y pb) speed (zip (x : y : zs) (y : zs)) g
|
||||
(x : y : zs) -> divideDoorPane Nothing wl cond (soff - dist y pb) speed (zip (x : y : zs) (y : zs)) g
|
||||
_ -> error "tried to create doorBetween with too few points"
|
||||
where
|
||||
adoor =
|
||||
@@ -65,7 +62,6 @@ doorBetween isauto wl cond soff pa pb speed g = case divideLine 40 pa pb of
|
||||
|
||||
|
||||
divideDoorPane ::
|
||||
Bool ->
|
||||
Maybe Int ->
|
||||
Wall ->
|
||||
WdBl ->
|
||||
@@ -74,9 +70,9 @@ divideDoorPane ::
|
||||
[(Point2, Point2)] ->
|
||||
(Placement -> Maybe Placement) ->
|
||||
Placement
|
||||
divideDoorPane isauto mid wl cond soff speed ppairs g = case ppairs of
|
||||
divideDoorPane mid wl cond soff speed ppairs g = case ppairs of
|
||||
[p] -> ptCont (adoor p) g
|
||||
(p : ps) -> ptCont (adoor p) $ \pl -> Just $ divideDoorPane isauto (_plMID pl) wl cond soff speed ps g
|
||||
(p : ps) -> ptCont (adoor p) $ \pl -> Just $ divideDoorPane (_plMID pl) wl cond soff speed ps g
|
||||
_ -> undefined
|
||||
where
|
||||
adoor (x, y) = putSlideDr thedoor wl soff x y
|
||||
@@ -92,7 +88,6 @@ putAutoDoor a b = Placement (PS 0 0) (PutCoord a) Nothing Nothing $ \_ apl ->
|
||||
y = w ^?! gwWorld . coordinates . ix (bpl ^?! plMID . _Just)
|
||||
in Just $
|
||||
putDoubleDoor
|
||||
True
|
||||
defaultAutoWall
|
||||
(WdBlCrFilterNearPoint 40 (0.5 *^ (x + y)) CrIsAnimate)
|
||||
a
|
||||
|
||||
Reference in New Issue
Block a user