diff options
author | Griffin Smith <root@gws.fyi> | 2020-01-03T23·28-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-01-03T23·28-0500 |
commit | 84f32efad4ff6d358fdeb985b3b4ac408e753b78 (patch) | |
tree | d22d15bbbd88d9dd253f13dd9bf64205022686b4 /src/Xanthous/Entities/Entities.hs | |
parent | 1b88921bc36e5da1ade5c52827d057dc2be65bc5 (diff) |
Track entity collision in the Entity class
Rather than having a single function in the Game.Lenses module for determining what collision type if any an entity has, track it in the Entity typeclass itself. This is both more extensible and a better separation of concerns and gets rid of one of the two needs for a circular import. Yay! As part of this, I realized nothing was being done to prevent doors from being placed on tiles that already had walls (since now that was properly causing a collision!) so I've fixed that as well.
Diffstat (limited to 'src/Xanthous/Entities/Entities.hs')
-rw-r--r-- | src/Xanthous/Entities/Entities.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Xanthous/Entities/Entities.hs b/src/Xanthous/Entities/Entities.hs index 8793565a2a34..1e533a297310 100644 --- a/src/Xanthous/Entities/Entities.hs +++ b/src/Xanthous/Entities/Entities.hs @@ -47,6 +47,7 @@ instance Entity SomeEntity where blocksVision (SomeEntity ent) = blocksVision ent description (SomeEntity ent) = description ent entityChar (SomeEntity ent) = entityChar ent + entityCollision (SomeEntity ent) = entityCollision ent instance Function SomeEntity where function = functionJSON |