Hlint cleanup
This commit is contained in:
@@ -4,4 +4,4 @@ import ShapePicture
|
||||
|
||||
-- not currently used, too simple
|
||||
drawCorpse :: Corpse -> SPic
|
||||
drawCorpse cp = _cpSPic cp
|
||||
drawCorpse = _cpSPic
|
||||
|
||||
@@ -43,4 +43,3 @@ armourChaseCrit = chaseCrit
|
||||
}
|
||||
& crEquipment . at OnChest ?~ 0
|
||||
& crInvEquipped . at 0 ?~ OnChest
|
||||
where
|
||||
|
||||
@@ -64,7 +64,7 @@ crSafeDistFromTarg d cr = case cr ^? crIntention . targetCr . _Just of
|
||||
Nothing -> True
|
||||
|
||||
crStratConMatches :: Strategy -> Creature -> Bool
|
||||
crStratConMatches strat cr = strat == (_apStrategy $ _crActionPlan cr)
|
||||
crStratConMatches strat cr = strat == _apStrategy (_crActionPlan cr)
|
||||
-- this equality check might be slow...
|
||||
|
||||
crAwayFromPost :: Creature -> Bool
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
{- |
|
||||
Weapon effects when pulling the trigger. -}
|
||||
module Dodge.Item.Weapon.TriggerType
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ generateLevelFromRoomList gr' w = initWallZoning
|
||||
, _gameRooms = gameRoomsFromRooms (IM.elems rs')
|
||||
, _pathGraph = path
|
||||
}
|
||||
& pnZoning .~ foldl' (flip $ zonePn) mempty (labNodes path)
|
||||
& peZoning .~ foldl' (flip $ zonePe) mempty (labEdges path)
|
||||
& pnZoning .~ foldl' (flip zonePn) mempty (labNodes path)
|
||||
& peZoning .~ foldl' (flip zonePe) mempty (labEdges path)
|
||||
where
|
||||
(_,path) = pairsToGraph pairPath'
|
||||
pairPath = foldMap _rmPath rs
|
||||
|
||||
@@ -284,7 +284,7 @@ innerSquare :: [Point2]
|
||||
innerSquare = [V2 1 1, V2 (-1) 1, V2 (-1) (-1), V2 1 (-1)]
|
||||
|
||||
drawWallSearchRays :: World -> Picture
|
||||
drawWallSearchRays w = foldMap f $ map fst $ allVisibleWalls w
|
||||
drawWallSearchRays w = foldMap (f . fst) $ allVisibleWalls w
|
||||
where
|
||||
f p = setLayer DebugLayer $ color yellow $ uncurryV translate p (circle 5)
|
||||
<> line [_cameraViewFrom w, p]
|
||||
|
||||
@@ -35,7 +35,7 @@ updateCamera :: Universe -> Universe
|
||||
updateCamera uv = uv
|
||||
& over uvWorld (setViewDistance cfig )
|
||||
& moveZoomCamera
|
||||
& over uvWorld (updateScopeZoom )
|
||||
& over uvWorld updateScopeZoom
|
||||
& over uvWorld (rotateCamera cfig )
|
||||
where
|
||||
cfig = _uvConfig uv
|
||||
|
||||
@@ -55,7 +55,7 @@ crsHit sp ep w
|
||||
|
||||
thingHitFilt :: (Creature -> Bool) -> (Wall -> Bool)
|
||||
-> Point2 -> Point2 -> World -> Maybe (Point2, Either Creature Wall)
|
||||
thingHitFilt fcr fwl sp ep = listToMaybe . filter (f . snd) . thingsHit sp ep
|
||||
thingHitFilt fcr fwl sp ep = List.find (f . snd) . thingsHit sp ep
|
||||
where
|
||||
f (Left cr) = fcr cr
|
||||
f (Right wl) = fwl wl
|
||||
|
||||
@@ -23,7 +23,7 @@ makeIntInterval x y
|
||||
|
||||
makeInt2Interval :: Int2 -> Int2 -> [Int2]
|
||||
makeInt2Interval (V2 x1 y1) (V2 x2 y2)
|
||||
= [(V2 x y) | x <- makeIntInterval x1 x2, y <- makeIntInterval y1 y2]
|
||||
= [V2 x y | x <- makeIntInterval x1 x2, y <- makeIntInterval y1 y2]
|
||||
|
||||
zoneOfPoint' :: Float -> Point2 -> Int2
|
||||
zoneOfPoint' s = fmap (divTo s)
|
||||
@@ -35,7 +35,7 @@ zoneExtract :: Monoid m => Int2 -> IM.IntMap (IM.IntMap m) -> m
|
||||
zoneExtract (V2 x y) = fromMaybe mempty . (^? ix x . ix y)
|
||||
--
|
||||
zonesExtract :: Monoid m => IM.IntMap (IM.IntMap m) -> [Int2] -> m
|
||||
zonesExtract im = foldMap (flip zoneExtract im)
|
||||
zonesExtract im = foldMap (`zoneExtract` im)
|
||||
|
||||
xIntercepts' :: Float -> Point2 -> Point2 -> [Point2]
|
||||
{-# INLINE xIntercepts' #-}
|
||||
|
||||
@@ -36,7 +36,7 @@ zoneOfCr :: Creature -> [Int2]
|
||||
zoneOfCr cr = zoneOfCirc crZoneSize (_crPos cr) (_crRad cr)
|
||||
|
||||
minCrIXOn :: Ord a => (Creature -> a) -> IS.IntSet -> World -> Maybe Creature
|
||||
minCrIXOn f is w = fmap fst $ IS.foldl' g Nothing is
|
||||
minCrIXOn f is w = fst <$> IS.foldl' g Nothing is
|
||||
where
|
||||
g mcrx cid = minOn snd <$> getpair cid <*> mcrx
|
||||
getpair cid = fmap h $ w ^? creatures . ix cid
|
||||
|
||||
Reference in New Issue
Block a user