AI refactor
This commit is contained in:
@@ -137,6 +137,9 @@ performAction cr w ac = case ac of
|
||||
(imps, Just ac) -> (imps, Just $ DoActionWhilePartial ac f resetAc)
|
||||
(imps, _) -> (imps, Just $ DoActionWhilePartial resetAc f resetAc)
|
||||
| otherwise -> performAction cr w partAc
|
||||
DoActionIf f ac
|
||||
| f (w,cr) -> performAction cr w ac
|
||||
| otherwise -> ([],Nothing)
|
||||
DoActionIfElse ac f ac'
|
||||
| f (w,cr) -> performAction cr w ac
|
||||
| otherwise -> performAction cr w ac'
|
||||
@@ -164,7 +167,9 @@ performAction cr w ac = case ac of
|
||||
_ -> ([],Nothing)
|
||||
UseAheadPos f -> performAction cr w (f (_crPos cr +.+ 20 *.* unitVectorAtAngle (_crDir cr)))
|
||||
ArbitraryAction f -> performAction cr w (f cr w)
|
||||
DoImpulsesAlongside sideImpulses mainAc -> undefined
|
||||
DoImpulsesAlongside sideImp mainAc -> case performAction cr w mainAc of
|
||||
(imp, Just ac) -> (sideImp ++ imp, Just $ DoImpulsesAlongside sideImp ac)
|
||||
(imp, _) -> (sideImp ++ imp, Nothing)
|
||||
DoReplicate t ac -> performAction cr w $ DoReplicatePartial ac t ac
|
||||
DoReplicatePartial _ 0 ac' -> performAction cr w ac'
|
||||
DoReplicatePartial ac t ac' -> case performAction cr w ac' of
|
||||
|
||||
Reference in New Issue
Block a user