Start to implement equipment sites on body

This commit is contained in:
2022-05-21 12:13:50 +01:00
parent bc0f7ada3c
commit 398ed6d982
8 changed files with 94 additions and 23 deletions
+5 -5
View File
@@ -112,15 +112,15 @@ mvSonicWave w pt
dosplit :: [Maybe ((Point2,Float),(Bool,Bool))] -> [[(Point2,Float)]]
dosplit (x:xs) = case x of
Nothing -> [] : dosplit xs
Just (pair,(True,True)) -> onHead (pair:) $ dosplit xs
Just (pair,(False,True)) -> [] : onHead (pair:) (dosplit xs)
Just (pair,(True,True)) -> overHead (pair:) $ dosplit xs
Just (pair,(False,True)) -> [] : overHead (pair:) (dosplit xs)
Just (pair,(True,False)) -> [pair] : dosplit xs
Just (_,(False,False)) -> [] : dosplit xs
dosplit [] = [[]]
onHead :: (a -> a) -> [a] -> [a]
onHead f (x:xs) = f x: xs
onHead _ [] = []
overHead :: (a -> a) -> [a] -> [a]
overHead f (x:xs) = f x: xs
overHead _ [] = []
reflectShockLine :: Wall -> Point2 -> Point2 -> Point2 -> Maybe ((Point2,Float),(Bool,Bool))