Describe what you see when you walk over items

Every step the character takes, describe the entities at that position
excluding the character.
This commit is contained in:
Griffin Smith 2019-09-20 19:38:16 -04:00
parent 4db3a68efe
commit dd16166665
12 changed files with 82 additions and 14 deletions

View file

@ -1,17 +1,19 @@
{-# LANGUAGE TemplateHaskell #-}
--------------------------------------------------------------------------------
module Xanthous.Entities.Item
( Item(..)
, itemType
, newWithType
) where
--------------------------------------------------------------------------------
import Xanthous.Prelude
import Test.QuickCheck
import Data.Aeson (ToJSON, FromJSON)
import Data.Aeson.Generic.DerivingVia
import Xanthous.Prelude
import Test.QuickCheck
import Data.Aeson (ToJSON, FromJSON)
import Data.Aeson.Generic.DerivingVia
--------------------------------------------------------------------------------
import Xanthous.Entities.RawTypes hiding (Item)
import Xanthous.Entities (Draw(..), Entity(..), DrawRawChar(..))
import Xanthous.Entities.RawTypes hiding (Item, description)
import qualified Xanthous.Entities.RawTypes as Raw
import Xanthous.Entities (Draw(..), Entity(..), DrawRawChar(..))
--------------------------------------------------------------------------------
data Item = Item
@ -30,6 +32,7 @@ instance Arbitrary Item where
instance Entity Item where
blocksVision _ = False
description = view $ itemType . Raw.description
newWithType :: ItemType -> Item
newWithType = Item