From 1293aa0fdff8bf1b826d7ff477b59d88eb171ab4 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 5 Jun 2025 13:24:43 +0100 Subject: [PATCH] Remove some Aeson processing --- src/Dodge/Data/ComposedItem.hs | 8 ++++---- src/Dodge/Data/WorldEffect.hs | 5 +---- src/Dodge/WorldEffect.hs | 16 ++++++++-------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Dodge/Data/ComposedItem.hs b/src/Dodge/Data/ComposedItem.hs index 066c8b5ae..79ab26179 100644 --- a/src/Dodge/Data/ComposedItem.hs +++ b/src/Dodge/Data/ComposedItem.hs @@ -8,8 +8,8 @@ module Dodge.Data.ComposedItem where import Dodge.Data.AmmoType import Dodge.Data.DoubleTree import Control.Lens -import Data.Aeson -import Data.Aeson.TH +--import Data.Aeson +--import Data.Aeson.TH import Dodge.Data.Item import Geometry.Data import Linear.Quaternion (Quaternion (..)) @@ -91,5 +91,5 @@ makeLenses ''ItemLink makeLenses ''LinkTest makeLenses ''LinkUpdate makeLenses ''ComposeLinkType -deriveJSON defaultOptions ''ItemStructuralFunction -deriveJSON defaultOptions ''ComposeLinkType +--deriveJSON defaultOptions ''ItemStructuralFunction +--deriveJSON defaultOptions ''ComposeLinkType diff --git a/src/Dodge/Data/WorldEffect.hs b/src/Dodge/Data/WorldEffect.hs index f37414b8f..6cc1775cb 100644 --- a/src/Dodge/Data/WorldEffect.hs +++ b/src/Dodge/Data/WorldEffect.hs @@ -7,12 +7,9 @@ module Dodge.Data.WorldEffect where import Dodge.Data.Input import Dodge.Data.LightSource -import Dodge.Data.ComposedItem -import Dodge.Data.DoubleTree import Data.Aeson import Data.Aeson.TH import Dodge.Data.CreatureEffect -import Dodge.Data.Item import Dodge.Data.SoundOrigin import Geometry.Data import Sound.Data @@ -32,7 +29,7 @@ data WdWd | MakeStartCloudAt Point3 | TorqueCr Float Int | WdWdNegateTrig Int - | WdWdFromItCrixWdWd (LabelDoubleTree ComposeLinkType Item) Int ItCrWdWd +-- | WdWdFromItCrixWdWd (LabelDoubleTree ComposeLinkType Item) Int ItCrWdWd | MakeTempLight LSParam Int | UseInvItem Int PressType | WdWdBurstFireRepetition Int Int diff --git a/src/Dodge/WorldEffect.hs b/src/Dodge/WorldEffect.hs index 6378ff4f1..3eb7bbafd 100644 --- a/src/Dodge/WorldEffect.hs +++ b/src/Dodge/WorldEffect.hs @@ -8,7 +8,7 @@ module Dodge.WorldEffect ( import Dodge.Item.Grammar import Dodge.Creature.Impulse.UseItem import Dodge.BlBl -import Dodge.Data.Input +--import Dodge.Data.Input import Dodge.HeldUse import Dodge.Data.ComposedItem import Dodge.Data.DoubleTree @@ -38,9 +38,9 @@ doWdWd we = case we of TorqueCr x cid -> torqueCr x cid SoundStart so p sid mi -> soundStart so p sid mi WdWdNegateTrig trid -> cWorld . lWorld . triggers . ix trid %~ not - WdWdFromItCrixWdWd it crid f -> \w -> fromMaybe w $ do - cr <- w ^? cWorld . lWorld . creatures . ix crid - return $ doItCrWdWd f it cr w +-- WdWdFromItCrixWdWd it crid f -> \w -> fromMaybe w $ do +-- cr <- w ^? cWorld . lWorld . creatures . ix crid +-- return $ doItCrWdWd f it cr w MakeTempLight _ 0 -> id MakeTempLight x t -> (cWorld . lWorld . lights .:~ x) . (cWorld . lWorld . worldEvents .:~ MakeTempLight x (t-1)) @@ -51,10 +51,10 @@ doWdWd we = case we of allInvLocs (cr ^. crInv) ^? ix invid . _2 . locLDT return $ heldEffectMuzzles itree cr w -doItCrWdWd :: ItCrWdWd -> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World -doItCrWdWd icww = case icww of - ItCrWdItemHeldEffect -> heldEffect InitialPress - ItCrWdItemHeldEffectNoHammer -> heldEffectNoHammerCheck +--doItCrWdWd :: ItCrWdWd -> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World +--doItCrWdWd icww = case icww of +-- ItCrWdItemHeldEffect -> heldEffect InitialPress +-- ItCrWdItemHeldEffectNoHammer -> heldEffectNoHammerCheck accessTerminal :: Maybe Int -> World -> World accessTerminal mtmid w = fromMaybe w $ do