diff options
author | Juan J. Martinez <jjm@usebox.net> | 2024-05-11 08:45:49 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2024-05-11 08:45:49 +0100 |
commit | e44005c482d86aa30739ac97ad11e2c7c0fd0238 (patch) | |
tree | c10cab746e14952a23a73571e728a3adedb5b4e9 | |
parent | ae8a5cca3a6570c7107d638b265b36f04c4bd598 (diff) | |
download | space-plat-hs-e44005c482d86aa30739ac97ad11e2c7c0fd0238.tar.gz space-plat-hs-e44005c482d86aa30739ac97ad11e2c7c0fd0238.zip |
Simplified
-rw-r--r-- | src/Game/Map.hs | 4 |
1 files 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 |