Remove redundant placement generation
This commit is contained in:
@@ -57,7 +57,6 @@ data PSType
|
|||||||
| PutForeground ForegroundShape
|
| PutForeground ForegroundShape
|
||||||
| PutWorldUpdate (PlacementSpot -> World -> World)
|
| PutWorldUpdate (PlacementSpot -> World -> World)
|
||||||
| PutNothing
|
| PutNothing
|
||||||
| PutUsingGenParams (World -> (World, PSType))
|
|
||||||
| PutID {_putID :: Int}
|
| PutID {_putID :: Int}
|
||||||
| PutChasm {_putChasmPoly :: [Point2]}
|
| PutChasm {_putChasmPoly :: [Point2]}
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ import Geometry
|
|||||||
damageSensor :: SensorType -> Float -> Maybe Int -> PlacementSpot -> Placement
|
damageSensor :: SensorType -> Float -> Maybe Int -> PlacementSpot -> Placement
|
||||||
damageSensor dt wdth mtrid 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 -> psPtJpl ps
|
\lsid -> psPtJpl ps
|
||||||
. PutUsingGenParams
|
$
|
||||||
$ \gw ->
|
PutMachine
|
||||||
( gw
|
|
||||||
, PutMachine
|
|
||||||
(reverse $ square wdth)
|
(reverse $ square wdth)
|
||||||
( defaultMachine
|
( defaultMachine
|
||||||
& mcColor .~ yellow
|
& mcColor .~ yellow
|
||||||
@@ -28,13 +26,11 @@ damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
|
|||||||
( DamSensor
|
( DamSensor
|
||||||
0
|
0
|
||||||
dt
|
dt
|
||||||
-- (_sensorCoding (_cwgParams $ _cwGen (_cWorld gw)) M.! dt)
|
|
||||||
(damageTypeThreshold dt)
|
(damageTypeThreshold dt)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
defaultSensorWall
|
defaultSensorWall
|
||||||
Nothing
|
Nothing
|
||||||
)
|
|
||||||
|
|
||||||
damageTypeThreshold :: SensorType -> Int
|
damageTypeThreshold :: SensorType -> Int
|
||||||
damageTypeThreshold dt = case dt of
|
damageTypeThreshold dt = case dt of
|
||||||
|
|||||||
@@ -126,9 +126,6 @@ placeSpotID' ps pt w = case pt of
|
|||||||
PutNothing -> (0, w)
|
PutNothing -> (0, w)
|
||||||
PutID i -> (i, w)
|
PutID i -> (i, w)
|
||||||
PutWorldUpdate f -> (0, w & f ps)
|
PutWorldUpdate f -> (0, w & f ps)
|
||||||
PutUsingGenParams f ->
|
|
||||||
let (w', pt') = f w
|
|
||||||
in placeSpotID' ps pt' w'
|
|
||||||
PutChasm ps' -> (0, w & cWorld . chasms .:~ map doShift ps')
|
PutChasm ps' -> (0, w & cWorld . chasms .:~ map doShift ps')
|
||||||
where
|
where
|
||||||
p@(V2 px py) = _psPos ps
|
p@(V2 px py) = _psPos ps
|
||||||
|
|||||||
Reference in New Issue
Block a user