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:
parent
4db3a68efe
commit
dd16166665
12 changed files with 82 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue