Move AmmoType, going towards no need for Aeson

This commit is contained in:
2025-06-05 13:16:57 +01:00
parent cff32e50f3
commit 7f1b790688
17 changed files with 241 additions and 242 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
module Dodge.Default.Item (
defaultHeldItem,
singleAmmo,
-- singleAmmo,
defaultBulletWeapon,
-- defaultLeftItem,
defaultCraftItem,
@@ -8,7 +8,7 @@ module Dodge.Default.Item (
) where
import Control.Lens
import qualified Data.IntMap.Strict as IM
--import qualified Data.IntMap.Strict as IM
import Dodge.Data.Item
import Dodge.Default.Item.Use
--import Geometry.Data
@@ -21,7 +21,7 @@ defaultHeldItem =
, _itEffect = defaultItEffect
, _itID = 0 -- should this return an error ? const $ error "itID not correctly initialised" ?
, _itTargeting = NoItTargeting
, _itAmmoSlots = mempty
-- , _itAmmoSlots = mempty
, _itLocation = InVoid
, _itUse = UseHeld
, _itParams = NoParams
@@ -36,13 +36,13 @@ defaultHeldItem =
defaultCraftItem :: Item
defaultCraftItem = defaultHeldItem & itUse .~ UseNothing
singleAmmo :: a -> IM.IntMap a
singleAmmo x = IM.insert 0 x mempty
--singleAmmo :: a -> IM.IntMap a
--singleAmmo x = IM.insert 0 x mempty
defaultBulletWeapon :: Item
defaultBulletWeapon =
defaultHeldItem
& itAmmoSlots .~ singleAmmo BulletAmmo
-- & itAmmoSlots .~ singleAmmo BulletAmmo
-- & itUse . heldMuzzles .~
-- [Muzzle (V2 15 0) 0 0.01 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]