smarties-1.2.1: Haskell Behavior Tree Library

Copyright(c) Peter Lu 2018
LicenseGPL-3
Maintainerchippermonky@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Smarties.Builders

Description

 
Synopsis

Documentation

helpers for building NodeSequenceT out of functions

data Utility g p a where Source #

Utility nodes produce a monadic return value and always have state SUCCESS

Constructors

Utility :: (g -> p -> (a, g)) -> Utility g p a 
SimpleUtility :: (p -> a) -> Utility g p a 

data UtilityT g p m a where Source #

transformer variant

Constructors

UtilityT :: Monad m => (g -> p -> m (a, g)) -> UtilityT g p m a 
SimpleUtilityT :: Monad m => (p -> m a) -> UtilityT g p m a 

data Perception g p where Source #

Perception nodes modify the perception

Constructors

Perception :: (g -> p -> (g, p)) -> Perception g p 
SimplePerception :: (p -> p) -> Perception g p 
ConditionalPerception :: (g -> p -> (Bool, g, p)) -> Perception g p 

data PerceptionT g p m where Source #

transformer variant

Constructors

PerceptionT :: (g -> p -> m (g, p)) -> PerceptionT g p m 
SimplePerceptionT :: (p -> m p) -> PerceptionT g p m 
ConditionalPerceptionT :: (g -> p -> m (Bool, g, p)) -> PerceptionT g p m 

data Action g p o where Source #

Action nodes add to the output and always have status SUCCESS

Constructors

Action :: (g -> p -> (g, o)) -> Action g p o 
SimpleAction :: (p -> o) -> Action g p o 

data ActionT g p o m where Source #

transformer variant

Constructors

ActionT :: (g -> p -> m (g, o)) -> ActionT g p o m 
SimpleActionT :: (p -> m o) -> ActionT g p o m 

data Condition g p where Source #

Condition nodes have status SUCCESS if they return true and FAIL otherwise

Constructors

Condition :: (g -> p -> (Bool, g)) -> Condition g p 
SimpleCondition :: (p -> Bool) -> Condition g p 

data ConditionT g p m where Source #

transformer variant

Constructors

ConditionT :: (g -> p -> m (Bool, g)) -> ConditionT g p m 
SimpleConditionT :: (p -> m Bool) -> ConditionT g p m 

data SelfAction g p o where Source #

SelfAction nodes are Action nodes that also apply the action to the perception

Constructors

SelfAction :: SelfActionable p o => (g -> p -> (g, o)) -> SelfAction g p o 
SimpleSelfAction :: SelfActionable p o => (p -> o) -> SelfAction g p o 

data SelfActionT g p o m where Source #

transformer variant

Constructors

SelfActionT :: SelfActionable p o => (g -> p -> m (g, o)) -> SelfActionT g p o m 
SimpleSelfActionT :: SelfActionable p o => (p -> m o) -> SelfActionT g p o m 

fromUtility :: Monad m => Utility g p a -> NodeSequenceT g p o m a Source #

convert Utility to NodeSequence

fromUtilityT :: Monad m => UtilityT g p m a -> NodeSequenceT g p o m a Source #

convert UtilityT to NodeSequenceT

fromPerception :: Monad m => Perception g p -> NodeSequenceT g p o m () Source #

converts Perception to NodeSequence

fromPerceptionT :: Monad m => PerceptionT g p m -> NodeSequenceT g p o m () Source #

converts PerceptionT to NodeSequenceT

fromCondition :: Monad m => Condition g p -> NodeSequenceT g p o m () Source #

converts Condition to NodeSequence

fromConditionT :: Monad m => ConditionT g p m -> NodeSequenceT g p o m () Source #

converts ConditionT to NodeSequenceT

fromAction :: Monad m => Action g p o -> NodeSequenceT g p o m () Source #

converts Action to NodeSequence

fromActionT :: Monad m => ActionT g p o m -> NodeSequenceT g p o m () Source #

converts ActionT to NodeSequenceT

fromSelfAction :: Monad m => SelfAction g p o -> NodeSequenceT g p o m () Source #

converts SelftAction to NodeSequence WARNING: may be deprecated in a future release

fromSelfActionT :: Monad m => SelfActionT g p o m -> NodeSequenceT g p o m () Source #

converts SelftActionT to NodeSequenceT WARNING: may be deprecated in a future release