LambdaHack-0.6.2.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Ability

Description

AI strategy abilities.

Synopsis

Documentation

data Ability Source #

Actor and faction abilities corresponding to client-server requests.

Instances

Bounded Ability Source # 
Enum Ability Source # 
Eq Ability Source # 

Methods

(==) :: Ability -> Ability -> Bool #

(/=) :: Ability -> Ability -> Bool #

Ord Ability Source # 
Show Ability Source # 
Generic Ability Source # 

Associated Types

type Rep Ability :: * -> * #

Methods

from :: Ability -> Rep Ability x #

to :: Rep Ability x -> Ability #

Binary Ability Source # 

Methods

put :: Ability -> Put #

get :: Get Ability #

putList :: [Ability] -> Put #

NFData Ability Source # 

Methods

rnf :: Ability -> () #

Hashable Ability Source # 

Methods

hashWithSalt :: Int -> Ability -> Int #

hash :: Ability -> Int #

type Rep Ability Source # 
type Rep Ability = D1 * (MetaData "Ability" "Game.LambdaHack.Common.Ability" "LambdaHack-0.6.2.0-6LvAjp6yuzE4Q9dWwe00a" False) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "AbMove" PrefixI False) (U1 *)) (C1 * (MetaCons "AbMelee" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "AbDisplace" PrefixI False) (U1 *)) (C1 * (MetaCons "AbAlter" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "AbWait" PrefixI False) (U1 *)) (C1 * (MetaCons "AbMoveItem" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "AbProject" PrefixI False) (U1 *)) (C1 * (MetaCons "AbApply" PrefixI False) (U1 *)))))

type Skills = EnumMap Ability Int Source #

Skill level in particular abilities.

This representation is sparse, so better than a record when there are more item kinds (with few abilities) than actors (with many abilities), especially if the number of abilities grows as the engine is developed. It's also easier to code and maintain.