From 97a5c61f28ba98728bab390e0ea745edfbea7103 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 30 Nov 2019 15:00:39 -0500 Subject: Fix an injectivity issue with saving the game Fix an injectivity issue with JSON-encoding the entity map that was causing the game saving to not properly round-trip. As part of this, there's a refactor to the internals of the entity map to use sets instead of vectors, which should also get us a nice perf boost. --- src/Xanthous/Entities/Item.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Xanthous/Entities/Item.hs') diff --git a/src/Xanthous/Entities/Item.hs b/src/Xanthous/Entities/Item.hs index 465110069c1d..0156cd54c8a7 100644 --- a/src/Xanthous/Entities/Item.hs +++ b/src/Xanthous/Entities/Item.hs @@ -21,7 +21,7 @@ import Xanthous.Game.State data Item = Item { _itemType :: ItemType } - deriving stock (Eq, Show, Generic) + deriving stock (Eq, Show, Ord, Generic) deriving anyclass (NFData, CoArbitrary, Function) deriving Draw via DrawRawChar "_itemType" Item deriving (ToJSON, FromJSON) -- cgit 1.4.1