LambdaHack-0.8.1.2: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.AI.Strategy

Description

AI strategies to direct actors not controlled directly by human players. No operation in this module involves the State tyep or any of our client/server monads types.

Synopsis

Documentation

data Strategy a Source #

A strategy is a choice of (non-empty) frequency tables of possible actions.

Instances
Monad Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

(>>=) :: Strategy a -> (a -> Strategy b) -> Strategy b #

(>>) :: Strategy a -> Strategy b -> Strategy b #

return :: a -> Strategy a #

fail :: String -> Strategy a #

Functor Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

fmap :: (a -> b) -> Strategy a -> Strategy b #

(<$) :: a -> Strategy b -> Strategy a #

Applicative Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

pure :: a -> Strategy a #

(<*>) :: Strategy (a -> b) -> Strategy a -> Strategy b #

liftA2 :: (a -> b -> c) -> Strategy a -> Strategy b -> Strategy c #

(*>) :: Strategy a -> Strategy b -> Strategy b #

(<*) :: Strategy a -> Strategy b -> Strategy a #

Foldable Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

fold :: Monoid m => Strategy m -> m #

foldMap :: Monoid m => (a -> m) -> Strategy a -> m #

foldr :: (a -> b -> b) -> b -> Strategy a -> b #

foldr' :: (a -> b -> b) -> b -> Strategy a -> b #

foldl :: (b -> a -> b) -> b -> Strategy a -> b #

foldl' :: (b -> a -> b) -> b -> Strategy a -> b #

foldr1 :: (a -> a -> a) -> Strategy a -> a #

foldl1 :: (a -> a -> a) -> Strategy a -> a #

toList :: Strategy a -> [a] #

null :: Strategy a -> Bool #

length :: Strategy a -> Int #

elem :: Eq a => a -> Strategy a -> Bool #

maximum :: Ord a => Strategy a -> a #

minimum :: Ord a => Strategy a -> a #

sum :: Num a => Strategy a -> a #

product :: Num a => Strategy a -> a #

Traversable Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

traverse :: Applicative f => (a -> f b) -> Strategy a -> f (Strategy b) #

sequenceA :: Applicative f => Strategy (f a) -> f (Strategy a) #

mapM :: Monad m => (a -> m b) -> Strategy a -> m (Strategy b) #

sequence :: Monad m => Strategy (m a) -> m (Strategy a) #

Alternative Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

empty :: Strategy a #

(<|>) :: Strategy a -> Strategy a -> Strategy a #

some :: Strategy a -> Strategy [a] #

many :: Strategy a -> Strategy [a] #

MonadPlus Strategy Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

mzero :: Strategy a #

mplus :: Strategy a -> Strategy a -> Strategy a #

Show a => Show (Strategy a) Source # 
Instance details

Defined in Game.LambdaHack.Client.AI.Strategy

Methods

showsPrec :: Int -> Strategy a -> ShowS #

show :: Strategy a -> String #

showList :: [Strategy a] -> ShowS #

liftFrequency :: Frequency a -> Strategy a Source #

Strategy where only the actions from the given single frequency table can be picked.

(.|) :: Strategy a -> Strategy a -> Strategy a infixr 2 Source #

Strategy with the actions from both argument strategies, with original frequencies.

reject :: Strategy a Source #

Strategy with no actions at all.

(.=>) :: Bool -> Strategy a -> Strategy a infix 3 Source #

Conditionally accepted strategy.

only :: (a -> Bool) -> Strategy a -> Strategy a Source #

Strategy with all actions not satisfying the predicate removed. The remaining actions keep their original relative frequency values.

bestVariant :: Strategy a -> Frequency a Source #

When better choices are towards the start of the list, this is the best frequency of the strategy.

renameStrategy :: Text -> Strategy a -> Strategy a Source #

Overwrite the description of all frequencies within the strategy.

returN :: Text -> a -> Strategy a Source #

Like return, but pick a name of the single frequency.

mapStrategyM :: Monad m => (a -> m (Maybe b)) -> Strategy a -> m (Strategy b) Source #