diff options
author | Griffin Smith <root@gws.fyi> | 2019-09-28T17·20-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-09-28T19·03-0400 |
commit | 1a0f618a829ec356e29176c77ea90a8a5a0157b4 (patch) | |
tree | 90d255974b482f6d59dd26a503d28e7adb090188 /src/Xanthous/Data.hs | |
parent | 915264acae35e71f79c6193d022baa2455d880d3 (diff) |
Implement the start of creature AI
Add a Brain class, which determines for an entity the set of moves it makes every step of the game, and begin to implement that for gormlaks. The idea here is that every step of the game, a gormlak will move towards the furthest-away wall it can see.
Diffstat (limited to 'src/Xanthous/Data.hs')
-rw-r--r-- | src/Xanthous/Data.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Xanthous/Data.hs b/src/Xanthous/Data.hs index afba273005f8..ff9da6280bfb 100644 --- a/src/Xanthous/Data.hs +++ b/src/Xanthous/Data.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveFoldable #-} @@ -74,6 +75,7 @@ data Positioned a where Positioned :: Position -> a -> Positioned a deriving stock (Show, Eq, Ord, Functor, Foldable, Traversable, Generic) deriving anyclass (CoArbitrary, Function) +type role Positioned representational _Positioned :: Iso (Position, a) (Position, b) (Positioned a) (Positioned b) _Positioned = iso hither yon |