Move machine update into outside function
This commit is contained in:
+8
-9
@@ -5,6 +5,7 @@ Description : Simulation update
|
||||
-}
|
||||
module Dodge.Update ( updateUniverse ) where
|
||||
import Dodge.Data
|
||||
import Dodge.Machine.Update
|
||||
import Dodge.RadarBlip
|
||||
import Dodge.Flare
|
||||
import Dodge.Menu
|
||||
@@ -14,7 +15,7 @@ import Dodge.Distortion
|
||||
import Dodge.SoundLogic
|
||||
--import Dodge.Wall.Delete
|
||||
import Dodge.Update.WallDamage
|
||||
import Dodge.Machine.Destroy
|
||||
--import Dodge.Machine.Destroy
|
||||
--import Dodge.Menu
|
||||
import Dodge.Base
|
||||
import Dodge.Zone
|
||||
@@ -89,7 +90,8 @@ functionalUpdate cfig w = checkEndGame
|
||||
. zoneClouds
|
||||
. updateMIM magnets _mgUpdate
|
||||
. updateIMl' _terminals tmUpdate
|
||||
. updateIMl _machines mcChooseUpdate
|
||||
-- . updateIMl _machines mcChooseUpdate
|
||||
. updateIMl' _machines updateMachine
|
||||
. updateIMl _creatures _crUpdate
|
||||
-- creatures should be updated early so that crOldPos is set before any position change
|
||||
. over creatures (fmap setOldPos)
|
||||
@@ -125,13 +127,10 @@ updateWorldSelect w = f . g $ case (w ^? mouseButtons . ix ButtonLeft, w ^? mous
|
||||
g | ButtonRight `M.member` _mouseButtons w = rSelect .~ mwp
|
||||
| otherwise = id
|
||||
|
||||
mcChooseUpdate :: Machine -> Machine -> World -> World
|
||||
mcChooseUpdate mc mc'
|
||||
| _mcHP mc > 0 = _mcUpdate mc mc'
|
||||
| otherwise = destroyMachine mc
|
||||
-- (machines %~ IM.delete (_mcID mc))
|
||||
-- . deleteWallIDs (_mcWallIDs mc)
|
||||
-- . _mcDeath mc mc'
|
||||
--mcChooseUpdate :: Machine -> Machine -> World -> World
|
||||
--mcChooseUpdate mc mc'
|
||||
-- | _mcHP mc > 0 = _mcUpdate mc mc'
|
||||
-- | otherwise = destroyMachine mc
|
||||
|
||||
tmUpdate :: Terminal -> World -> World
|
||||
tmUpdate tm w = case w ^? terminals . ix (_tmID tm) . tmFutureLines . ix 0 of
|
||||
|
||||
Reference in New Issue
Block a user