about summary refs log tree commit diff
path: root/src/Xanthous/Game/Lenses.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xanthous/Game/Lenses.hs')
-rw-r--r--src/Xanthous/Game/Lenses.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Xanthous/Game/Lenses.hs b/src/Xanthous/Game/Lenses.hs
index 48b7235d2263..5d5e673c5b88 100644
--- a/src/Xanthous/Game/Lenses.hs
+++ b/src/Xanthous/Game/Lenses.hs
@@ -8,6 +8,7 @@ module Xanthous.Game.Lenses
   , characterPosition
   , updateCharacterVision
   , characterVisiblePositions
+  , characterVisibleEntities
   , getInitialState
   , initialStateFromSeed
   , entitiesAtCharacter
@@ -28,7 +29,8 @@ import           Xanthous.Game.State
 import           Xanthous.Data
 import           Xanthous.Data.Levels
 import qualified Xanthous.Data.EntityMap as EntityMap
-import           Xanthous.Data.EntityMap.Graphics (visiblePositions)
+import           Xanthous.Data.EntityMap.Graphics
+                 (visiblePositions, visibleEntities)
 import           Xanthous.Data.VectorBag
 import           Xanthous.Entities.Character (Character, mkCharacter)
 import           {-# SOURCE #-} Xanthous.Entities.Entities ()
@@ -101,6 +103,11 @@ characterVisiblePositions game =
   let charPos = game ^. characterPosition
   in visiblePositions charPos visionRadius $ game ^. entities
 
+characterVisibleEntities :: GameState -> EntityMap.EntityMap SomeEntity
+characterVisibleEntities game =
+  let charPos = game ^. characterPosition
+  in visibleEntities charPos visionRadius $ game ^. entities
+
 entitiesCollision
   :: ( Functor f
     , forall xx. MonoFoldable (f xx)