diff options
author | Griffin Smith <root@gws.fyi> | 2020-05-10T23·50-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-05-10T23·50-0400 |
commit | 9ec51e51234b0c9ace93091d9071d932cf819f1f (patch) | |
tree | dbf2d63b69f16055c79b22b1f3f94b5ad31cac8d /test/Xanthous/Data/EntityMap/GraphicsSpec.hs | |
parent | 2320cfa8cd2540cd0caf91f2e7cdc81045c9504c (diff) |
Entities inside a wall can't see anything
The test for "one step in each cardinal direction is always visible" was giving a false-negative for an entity at the same position as a wall - not only is this something that would ostensibly never happen, it's also completely reasonable to assume that someone stuck in a wall (due to a bad teleport perhaps?) wouldn't be able to see anything, on account of their head being INSIDE A WALL.
Diffstat (limited to 'test/Xanthous/Data/EntityMap/GraphicsSpec.hs')
-rw-r--r-- | test/Xanthous/Data/EntityMap/GraphicsSpec.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/Xanthous/Data/EntityMap/GraphicsSpec.hs b/test/Xanthous/Data/EntityMap/GraphicsSpec.hs index 55ae0d79dbb8..fd37548ce864 100644 --- a/test/Xanthous/Data/EntityMap/GraphicsSpec.hs +++ b/test/Xanthous/Data/EntityMap/GraphicsSpec.hs @@ -19,6 +19,7 @@ test = testGroup "Xanthous.Data.EntityMap.Graphics" [ testGroup "visiblePositions" [ testProperty "one step in each cardinal direction is always visible" $ \pos (Cardinal dir) (Positive r) (wallPositions :: Set Position)-> + pos `notMember` wallPositions ==> let em = review _EntityMap . map (, Wall) . toList $ wallPositions em' = em & atPosition (move dir pos) %~ (Wall <|) poss = visiblePositions pos r em' |