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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.Analytics

Contents

- Internal operations

Description

Per-actor analytics of personal feats.

Synopsis

- type FactionAnalytics = EnumMap FactionId Analytics
- type ActorAnalytics = EnumMap ActorId Analytics
- type GenerationAnalytics = EnumMap SLore (EnumMap ItemId Int)
- type KillMap = EnumMap FactionId (EnumMap ItemId Int)
- newtype Analytics = Analytics {
  - akillCounts :: EnumMap KillHow KillMap
  }
- data KillHow
  - = KillKineticMelee
  - | KillKineticRanged
  - | KillKineticBlast
  - | KillKineticPush
  - | KillOtherMelee
  - | KillOtherRanged
  - | KillOtherBlast
  - | KillOtherPush
  - | KillActorLaunch
  - | KillTileLaunch
  - | KillDropLaunch
  - | KillCatch
- emptyAnalytics :: Analytics
- addFactionKill :: FactionId -> KillHow -> FactionId -> ItemId -> FactionAnalytics -> FactionAnalytics
- addActorKill :: ActorId -> KillHow -> FactionId -> ItemId -> ActorAnalytics -> ActorAnalytics
- addKill :: KillHow -> FactionId -> ItemId -> Maybe Analytics -> Analytics

# Documentation

type FactionAnalytics = EnumMap FactionId Analytics Source #

Summary analytics data for each faction.

type ActorAnalytics = EnumMap ActorId Analytics Source #

Analytics data for each live actor.

type GenerationAnalytics = EnumMap SLore (EnumMap ItemId Int) Source #

Statistics of possible and actual generation of items for each lore kind.

type KillMap = EnumMap FactionId (EnumMap ItemId Int) Source #

newtype Analytics Source #

Statistics of past events concerning an actor.

Constructors

Analytics |

Fields

- akillCounts :: EnumMap KillHow KillMap

#### Instances

Instances details

Binary Analytics Source # |
Instance details Defined in Game.LambdaHack.Common.Analytics Methods put :: Analytics -> Put Source # get :: Get Analytics Source # putList :: [Analytics] -> Put Source #
Show Analytics Source # |
Instance details Defined in Game.LambdaHack.Common.Analytics Methods showsPrec :: Int -> Analytics -> ShowS Source # show :: Analytics -> String Source # showList :: [Analytics] -> ShowS Source #
Eq Analytics Source # |
Instance details Defined in Game.LambdaHack.Common.Analytics Methods (==) :: Analytics -> Analytics -> Bool Source # (/=) :: Analytics -> Analytics -> Bool Source #

data KillHow Source #

Labels of individual kill count analytics.

Constructors

KillKineticMelee |
KillKineticRanged |
KillKineticBlast |
KillKineticPush |
KillOtherMelee |
KillOtherRanged |
KillOtherBlast |
KillOtherPush |
KillActorLaunch |
KillTileLaunch |
KillDropLaunch |
KillCatch |

#### Instances

Instances details

Binary KillHow Source # |
Instance details Defined in Game.LambdaHack.Common.Analytics Methods put :: KillHow -> Put Source # get :: Get KillHow Source # putList :: [KillHow] -> Put Source #
Enum KillHow Source # |

Instance details

Defined in Game.LambdaHack.Common.Analytics

Methods

succ :: KillHow -> KillHow Source #

pred :: KillHow -> KillHow Source #

toEnum :: Int -> KillHow Source #

fromEnum :: KillHow -> Int Source #

enumFrom :: KillHow -> [KillHow] Source #

enumFromThen :: KillHow -> KillHow -> [KillHow] Source #

enumFromTo :: KillHow -> KillHow -> [KillHow] Source #

enumFromThenTo :: KillHow -> KillHow -> KillHow -> [KillHow] Source #

Generic KillHow Source # |

Instance details

Defined in Game.LambdaHack.Common.Analytics

Associated Types

type Rep KillHow |

Instance details

Defined in Game.LambdaHack.Common.Analytics

type Rep KillHow = D1 ('MetaData "KillHow" "Game.LambdaHack.Common.Analytics" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (((C1 ('MetaCons "KillKineticMelee" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillKineticRanged" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillKineticBlast" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "KillKineticPush" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillOtherMelee" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillOtherRanged" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "KillOtherBlast" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillOtherPush" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillActorLaunch" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "KillTileLaunch" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillDropLaunch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillCatch" 'PrefixI 'False) (U1 :: Type -> Type)))))

Methods

from :: KillHow -> Rep KillHow x Source #

to :: Rep KillHow x -> KillHow Source #

Show KillHow Source # |
Instance details Defined in Game.LambdaHack.Common.Analytics Methods showsPrec :: Int -> KillHow -> ShowS Source # show :: KillHow -> String Source # showList :: [KillHow] -> ShowS Source #
Eq KillHow Source # |
Instance details Defined in Game.LambdaHack.Common.Analytics Methods (==) :: KillHow -> KillHow -> Bool Source # (/=) :: KillHow -> KillHow -> Bool Source #
type Rep KillHow Source # |

Instance details

Defined in Game.LambdaHack.Common.Analytics

type Rep KillHow = D1 ('MetaData "KillHow" "Game.LambdaHack.Common.Analytics" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (((C1 ('MetaCons "KillKineticMelee" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillKineticRanged" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillKineticBlast" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "KillKineticPush" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillOtherMelee" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillOtherRanged" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "KillOtherBlast" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillOtherPush" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillActorLaunch" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "KillTileLaunch" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KillDropLaunch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KillCatch" 'PrefixI 'False) (U1 :: Type -> Type)))))

emptyAnalytics :: Analytics Source #

addFactionKill :: FactionId -> KillHow -> FactionId -> ItemId -> FactionAnalytics -> FactionAnalytics Source #

addActorKill :: ActorId -> KillHow -> FactionId -> ItemId -> ActorAnalytics -> ActorAnalytics Source #

# Internal operations

addKill :: KillHow -> FactionId -> ItemId -> Maybe Analytics -> Analytics Source #