Tweaks before attempting to move zoning out of LWorld
This commit is contained in:
@@ -100,4 +100,3 @@ combineTwoModuleMaps =
|
|||||||
|
|
||||||
fullModuleName :: ItemModuleType -> String
|
fullModuleName :: ItemModuleType -> String
|
||||||
fullModuleName = fromMaybe "EMPTYMODULE" . moduleName
|
fullModuleName = fromMaybe "EMPTYMODULE" . moduleName
|
||||||
|
|
||||||
|
|||||||
+2
-14
@@ -244,16 +244,6 @@ functionalUpdate w =
|
|||||||
-- . over uvWorld updateInventorySelectionList
|
-- . over uvWorld updateInventorySelectionList
|
||||||
$ over (uvWorld . cWorld) updatePastWorlds w
|
$ over (uvWorld . cWorld) updatePastWorlds w
|
||||||
|
|
||||||
--updateInventorySelectionList :: World -> World
|
|
||||||
--updateInventorySelectionList w = w
|
|
||||||
-- & cWorld . lWorld . hud . hudElement . augmentedInventory .~ makeInventorySelectionList w
|
|
||||||
|
|
||||||
-- this can probably be unified with updateWheelEvents
|
|
||||||
|
|
||||||
--updateWheelEvents :: World -> World
|
|
||||||
--updateWheelEvents w = foldr ($) w (replicate (abs y) (updateWheelEvent (signum y)))
|
|
||||||
-- where
|
|
||||||
-- y = w ^. input . scrollAmount
|
|
||||||
updateWheelEvents :: World -> World
|
updateWheelEvents :: World -> World
|
||||||
updateWheelEvents w
|
updateWheelEvents w
|
||||||
| yi == 0 = w
|
| yi == 0 = w
|
||||||
@@ -368,10 +358,8 @@ setOldPos cr =
|
|||||||
-- Nothing' -> w & timeFlow .~ NormalTimeFlow
|
-- Nothing' -> w & timeFlow .~ NormalTimeFlow
|
||||||
|
|
||||||
zoneCreatures :: World -> World
|
zoneCreatures :: World -> World
|
||||||
zoneCreatures w =
|
zoneCreatures w = w & cWorld . lWorld . crZoning
|
||||||
w
|
.~ foldl' (flip zoneCreature) mempty (w ^. cWorld . lWorld . creatures)
|
||||||
& cWorld . lWorld . crZoning .~ mempty
|
|
||||||
& cWorld . lWorld . crZoning %~ \zn -> foldl' (flip zoneCreature) zn (w ^. cWorld . lWorld . creatures)
|
|
||||||
|
|
||||||
-- foldl' (flip $ updateZoning (\cr -> IM.insert (_crID cr) cr))
|
-- foldl' (flip $ updateZoning (\cr -> IM.insert (_crID cr) cr))
|
||||||
-- zn (_creatures w)
|
-- zn (_creatures w)
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ yIntercepts' s sp ep = map f $ xIntercepts s (f sp) (f ep)
|
|||||||
f (V2 x y) = V2 y x
|
f (V2 x y) = V2 y x
|
||||||
|
|
||||||
zoneMonoid :: Semigroup m => Int2 -> m -> IM.IntMap (IM.IntMap m) -> IM.IntMap (IM.IntMap m)
|
zoneMonoid :: Semigroup m => Int2 -> m -> IM.IntMap (IM.IntMap m) -> IM.IntMap (IM.IntMap m)
|
||||||
|
{-# INLINE zoneMonoid #-}
|
||||||
zoneMonoid (V2 x y) a = IM.insertWith f x $! IM.singleton y a
|
zoneMonoid (V2 x y) a = IM.insertWith f x $! IM.singleton y a
|
||||||
where
|
where
|
||||||
f _ = IM.insertWith (<>) y a
|
f _ = IM.insertWith (<>) y a
|
||||||
|
|||||||
Reference in New Issue
Block a user