Cleanup
This commit is contained in:
@@ -14,52 +14,25 @@ import Shape
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
import Control.Lens
|
||||
--import Data.Either
|
||||
|
||||
damageSensor
|
||||
:: DamageType -- Left gets sensed, Right does damage
|
||||
-> Float
|
||||
-> Maybe Int
|
||||
-- -> (Machine -> World -> World)
|
||||
-> PlacementSpot -> Placement
|
||||
damageSensor dt wdth mtrid -- upf
|
||||
ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1)
|
||||
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1)
|
||||
$ \lsid -> Just $ spNoID ps $ PutUsingGenParams
|
||||
$ \gw -> (,) gw $ PutMachine (reverse $ square wdth)
|
||||
(defaultMachine
|
||||
& mcColor .~ yellow
|
||||
& mcMounts . at ObTrigger .~ mtrid
|
||||
)
|
||||
{ _mcDraw = sensorSPic wdth $ _sensorCoding (_genParams gw) M.! dt
|
||||
-- , _mcUpdate = \mc -> upf mc . sensorUpdate dt mc
|
||||
, _mcSensor = SensorToggleAmount False 0
|
||||
, _mcLSs = [lsid]
|
||||
}
|
||||
$ \gw -> (,) gw $ PutMachine (reverse $ square wdth) $ defaultMachine
|
||||
& mcColor .~ yellow
|
||||
& mcMounts . at ObTrigger .~ mtrid
|
||||
& mcDraw .~ sensorSPic wdth (_sensorCoding (_genParams gw) M.! dt)
|
||||
& mcSensor .~ SensorToggleAmount False 0
|
||||
& mcLSs .~ [lsid]
|
||||
|
||||
lightSensor :: Float -- -> (Machine -> World -> World)
|
||||
-> Maybe Int
|
||||
-> PlacementSpot -> Placement
|
||||
lightSensor = damageSensor LASERING
|
||||
--
|
||||
--sensorUpdate :: DamageType -> Machine -> World -> World
|
||||
--sensorUpdate damF mc w = w & machines . ix mcid %~ upmc
|
||||
-- & lightSources . ix lsid %~ upls
|
||||
-- where
|
||||
-- upmc = ( mcSensor . sensAmount %~ \x' -> min 1000 (max 0 (x' - 5 + newSense)) )
|
||||
-- . ( mcHP -~ sum dam )
|
||||
-- . (mcDamage .~ [])
|
||||
-- x = _sensAmount $ _mcSensor mc
|
||||
-- mcid = _mcID mc
|
||||
-- lsid = head (_mcLSs mc)
|
||||
-- (senseData,dam) = partitionEithers $ map (damageUsing damF) $ _mcDamage mc
|
||||
-- newSense = sum senseData
|
||||
-- ni = fromIntegral x / 1000
|
||||
-- upls = lsParam . lsCol .~ V3 ni ni ni
|
||||
--
|
||||
--damageUsing :: DamageType -> Damage -> Either Int Int
|
||||
--damageUsing dt dm
|
||||
-- | _dmType dm == dt = Left $ _dmAmount dm
|
||||
-- | otherwise = Right 0
|
||||
|
||||
sensorSPic :: Float -> (PaletteColor,DecorationShape) -> Machine -> SPic
|
||||
sensorSPic wdth (pc,ds) mc = noPic
|
||||
|
||||
Reference in New Issue
Block a user