about summary refs log tree commit diff
path: root/src/Xanthous/Data/EntityMap.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-09-29T14·54-0400
committerGriffin Smith <root@gws.fyi>2019-09-29T14·54-0400
commit05da490185e970b2cfdf6c61f69932fa373993f6 (patch)
tree0fa9be2182e1359ce39d600089f6937bfdccd3aa /src/Xanthous/Data/EntityMap.hs
parentec39dc0a5bed58e0b0b48eeac98e0fd0ceaa65db (diff)
Gormlaks attack back
When gormlaks see the character, they step towards them and attack
dealing 1 damage when adjacent. Characters have hitpoints now, displayed
at the bottom of the game screen, and when the game is over they die.
Diffstat (limited to 'src/Xanthous/Data/EntityMap.hs')
-rw-r--r--src/Xanthous/Data/EntityMap.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Xanthous/Data/EntityMap.hs b/src/Xanthous/Data/EntityMap.hs
index 5b5e8a063f2c..a068828a157c 100644
--- a/src/Xanthous/Data/EntityMap.hs
+++ b/src/Xanthous/Data/EntityMap.hs
@@ -110,6 +110,9 @@ instance TraversableWithIndex EntityID EntityMap where
   itraversed = byID . itraversed . rmap sequenceA . distrib
   itraverse = itraverseOf itraversed
 
+type instance Element (EntityMap a) = a
+instance MonoFoldable (EntityMap a)
+
 emptyEntityMap :: EntityMap a
 emptyEntityMap = EntityMap mempty mempty 0