AI refactor

This commit is contained in:
jgk
2021-05-14 12:04:12 +02:00
parent 2dd3756682
commit 0b26761be5
14 changed files with 282 additions and 762 deletions
+6
View File
@@ -160,6 +160,7 @@ data Creature = Creature
, _crAttentionDir :: AttentionDir
, _crAwarenessLevel :: IM.IntMap AwarenessLevel
, _crFaction :: Faction
, _crGroup :: CrGroup
, _crTarget :: Maybe Int
}
data WorldState
@@ -492,6 +493,7 @@ infixr 9 `WaitThen`
infixr 9 `DoActionThen`
infixr 9 `DoActionWhile`
infixr 9 `DoReplicate`
infixr 9 `DoImpulsesAlongside`
data Action
= Attack
{_attackTargetID :: Int}
@@ -546,6 +548,10 @@ data Action
,_doActionWhileCondition :: ( (World, Creature) -> Bool)
,_doActionWhileAction :: Action
}
| DoActionIf
{_doActionIfCondition :: ( (World, Creature) -> Bool)
,_doActionIfAction :: Action
}
| DoActionIfElse
{_doActionIfElseIfAction :: Action
,_doActionIfElseCondition :: ( (World, Creature) -> Bool)