From e44005c482d86aa30739ac97ad11e2c7c0fd0238 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 11 May 2024 08:45:49 +0100 Subject: Simplified --- src/Game/Map.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Game/Map.hs b/src/Game/Map.hs index 8467989..425d0db 100644 --- a/src/Game/Map.hs +++ b/src/Game/Map.hs @@ -81,7 +81,7 @@ data Tile = Tile {id :: Int, animation :: Vector Frame} deriving (Show) -instance JSON a => JSON (Vector a) where +instance (JSON a) => JSON (Vector a) where showJSON = undefined readJSON obj = fmap Vector.fromList (readJSON obj) @@ -264,7 +264,7 @@ isPlayer _ = False -- | Return the number of batteries in a map. totalBatteries :: Map -> Int -totalBatteries (Map md _ _) = Vector.length $ Vector.filter isBattery (md.objects) +totalBatteries (Map md _ _) = Vector.length $ Vector.filter isBattery md.objects where isBattery :: Object -> Bool isBattery (BatteryEntity _ _) = True -- cgit v1.2.3