From 8a1235c3dcf7fe69b2e2ea3eea326858d26d38b9 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 29 Nov 2019 22:59:15 -0500 Subject: Use menus for combat and picking up items Refactor a bunch of stuff around to allow for polymorphically surfacing an EntityChar for all entities, and use this to write a generic `entityMenu` function, which generates a menu from the chars of a list of entities - and use that to fully implement (removing `undefined`) menus for both attacking and picking things up when there are multiple entities on the relevant tile. --- xanthous.cabal | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xanthous.cabal') diff --git a/xanthous.cabal b/xanthous.cabal index 7204dc0f0f13..a5fbe9b4dcea 100644 --- a/xanthous.cabal +++ b/xanthous.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 0ec32d45d89e30640d8d59137c5eaa80e5eed7eb31cb553d9b251db94ed1ba36 +-- hash: 2f93900ad18d56709eb363a7f8dd251a9474dd7092b1aef956389f32c036a121 name: xanthous version: 0.1.0.0 @@ -34,9 +34,9 @@ library Xanthous.App Xanthous.Command Xanthous.Data + Xanthous.Data.EntityChar Xanthous.Data.EntityMap Xanthous.Data.EntityMap.Graphics - Xanthous.Entities Xanthous.Entities.Character Xanthous.Entities.Creature Xanthous.Entities.Draw.Util @@ -81,6 +81,7 @@ library , brick , checkers , classy-prelude + , comonad , constraints , containers , data-default @@ -120,9 +121,9 @@ executable xanthous Xanthous.App Xanthous.Command Xanthous.Data + Xanthous.Data.EntityChar Xanthous.Data.EntityMap Xanthous.Data.EntityMap.Graphics - Xanthous.Entities Xanthous.Entities.Character Xanthous.Entities.Creature Xanthous.Entities.Draw.Util @@ -166,6 +167,7 @@ executable xanthous , brick , checkers , classy-prelude + , comonad , constraints , containers , data-default @@ -203,10 +205,10 @@ test-suite test main-is: Spec.hs other-modules: Test.Prelude + Xanthous.Data.EntityCharSpec Xanthous.Data.EntityMapSpec Xanthous.DataSpec Xanthous.Entities.RawsSpec - Xanthous.EntitiesSpec Xanthous.GameSpec Xanthous.Generators.UtilSpec Xanthous.MessageSpec @@ -228,6 +230,7 @@ test-suite test , brick , checkers , classy-prelude + , comonad , constraints , containers , data-default -- cgit 1.4.1