Decouple Gormlak AI from creatures
Decouple the definition of the Gormlak AI from the creature type itself using generic lenses and a "HasVisionRadius" typeclass, to begin to untangle the hs-boot web of circular dependencies. This actually *increases* the number of hs-boot files from 1 to 2, but both of the source imports that use them are single-instance (unlike gormlak AI which I would expect to grow linearly with the growth of the game), plus at least one should be able to go away once we remove collision from the game lenses module and move it into something defined in the entity class itself.
This commit is contained in:
parent
c4351d46ef
commit
1b88921bc3
9 changed files with 149 additions and 81 deletions
|
|
@ -27,9 +27,9 @@ import qualified Xanthous.Data.EntityMap as EntityMap
|
|||
import Xanthous.Data.EntityMap.Graphics (visiblePositions)
|
||||
import Xanthous.Entities.Character (Character, mkCharacter)
|
||||
import Xanthous.Entities.Environment (Door, open, GroundMessage)
|
||||
import Xanthous.Entities.Item (Item)
|
||||
import Xanthous.Entities.Creature (Creature)
|
||||
import Xanthous.Entities.Entities ()
|
||||
import Xanthous.Entities.Item (Item)
|
||||
import {-# SOURCE #-} Xanthous.Entities.Creature (Creature)
|
||||
import {-# SOURCE #-} Xanthous.Entities.Entities ()
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
getInitialState :: IO GameState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue