From 052bc8455a99e7f1a90b6c9354e54cff10de02cc Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 23 Dec 2019 12:19:51 -0500 Subject: Add a drop command Add a drop command, bound to 'd', which prompts the character for an item in their inventory, removes it from the inventory, and places it on the ground. Along the way I had to fix a bug in the `EntityMap.atPosition` lens, which was always appending to the existing entities at the position on set, without removing the entities that were already there - the rabbit hole of quickchecking the lens laws here also lead to replacing the target of this lens with a newtype called `VectorBag`, which ignores order (since the entitymap makes no guarantees about order of entities at a given position). --- xanthous.cabal | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xanthous.cabal') diff --git a/xanthous.cabal b/xanthous.cabal index 7198e9ab9d9a..e70a7391f3c1 100644 --- a/xanthous.cabal +++ b/xanthous.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 0476b4307dfceb20b9358ca2e6f78c753e3e0a4ae60c6faed54528f6a9c0dc5c +-- hash: ae5b84ec168dd61b715e874bcb49579697873b164c43027a776dda725dfdffbf name: xanthous version: 0.1.0.0 @@ -37,6 +37,7 @@ library Xanthous.Data.EntityChar Xanthous.Data.EntityMap Xanthous.Data.EntityMap.Graphics + Xanthous.Data.VectorBag Xanthous.Entities.Character Xanthous.Entities.Creature Xanthous.Entities.Draw.Util @@ -96,7 +97,6 @@ library , megaparsec , mtl , optparse-applicative - , parallel , quickcheck-instances , quickcheck-text , random @@ -125,6 +125,7 @@ executable xanthous Xanthous.Data.EntityChar Xanthous.Data.EntityMap Xanthous.Data.EntityMap.Graphics + Xanthous.Data.VectorBag Xanthous.Entities.Character Xanthous.Entities.Creature Xanthous.Entities.Draw.Util @@ -183,7 +184,6 @@ executable xanthous , megaparsec , mtl , optparse-applicative - , parallel , quickcheck-instances , quickcheck-text , random @@ -248,7 +248,6 @@ test-suite test , megaparsec , mtl , optparse-applicative - , parallel , quickcheck-instances , quickcheck-text , random -- cgit 1.4.1