Remove Reader monad from multiple creature ais
This commit is contained in:
@@ -215,6 +215,18 @@ flockToPointUsing pf mvf cr = reader $ \w -> case _targetCr $ _crIntention cr of
|
||||
where
|
||||
cenp = _crGroupCenter $ _creatureGroups w IM.! _crGroupID (_crGroup cr)
|
||||
ptarg = pf tcr cenp cr
|
||||
flockToPointUsing'
|
||||
:: (Creature -> Point2 -> Creature -> Point2)
|
||||
-> (Point2 -> Creature -> Creature -> [Impulse])
|
||||
-> World
|
||||
-> Creature
|
||||
-> Creature
|
||||
flockToPointUsing' pf mvf w cr = case _targetCr $ _crIntention cr of
|
||||
Nothing -> cr
|
||||
Just tcr -> cr & crActionPlan . crImpulse .~ mvf ptarg cr tcr
|
||||
where
|
||||
cenp = _crGroupCenter $ _creatureGroups w IM.! _crGroupID (_crGroup cr)
|
||||
ptarg = pf tcr cenp cr
|
||||
|
||||
flockFunc
|
||||
:: (Creature -> Point2 -> Creature -> Point2)
|
||||
|
||||
Reference in New Issue
Block a user