Add indexed world modifications, example use in flicker lights

This commit is contained in:
2021-11-17 11:24:40 +00:00
parent 559d7e3a23
commit 9db091597d
10 changed files with 110 additions and 32 deletions
+11
View File
@@ -70,6 +70,7 @@ data World = World
, _randGen :: StdGen
, _mousePos :: !Point2
, _testString :: World -> [String]
, _modifications :: IM.IntMap Modification
, _yourID :: !Int
, _worldEvents :: World -> World
, _pressPlates :: IM.IntMap PressPlate
@@ -484,6 +485,15 @@ data PjParam = PjParam
, _pjMaxParam :: Int
, _pjDisplayParam :: Int -> String
}
data Modification
= ModIDTimerPoint3Bool
{ _mdID :: Int
, _mdExternalID :: Int
, _mdUpdate :: Modification -> World -> World
, _mdTimer :: Int
, _mdPoint3 :: Point3
, _mdBool :: Bool
}
data Prop
= Projectile
{ _pjPos :: Point2
@@ -792,6 +802,7 @@ makeLenses ''FloorItem
makeLenses ''Ammo
makeLenses ''PjParam
makeLenses ''Prop
makeLenses ''Modification
makeLenses ''Particle
makeLenses ''Wall
makeLenses ''WallStructure