about summary refs log blame commit diff
path: root/src/Xanthous/Entities/Arbitrary.hs
blob: 2d1890f787a373bc1f26f3082b3413f8635c10bb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                                

                                           




                                                                                
                                         



                                        
     
{-# OPTIONS_GHC -fno-warn-orphans #-}
--------------------------------------------------------------------------------
module Xanthous.Entities.Arbitrary () where
--------------------------------------------------------------------------------
import           Xanthous.Prelude
--------------------------------------------------------------------------------
import           Test.QuickCheck
import qualified Test.QuickCheck.Gen as Gen
--------------------------------------------------------------------------------
import           Xanthous.Entities (SomeEntity(..))
import           Xanthous.Entities.Character
import           Xanthous.Entities.Item
import           Xanthous.Entities.Creature
import           Xanthous.Entities.Environment
--------------------------------------------------------------------------------

instance Arbitrary SomeEntity where
  arbitrary = Gen.oneof
    [ SomeEntity <$> arbitrary @Character
    , SomeEntity <$> arbitrary @Item
    , SomeEntity <$> arbitrary @Creature
    , SomeEntity <$> arbitrary @Wall
    , SomeEntity <$> arbitrary @Door
    ]