Remove some Aeson processing

This commit is contained in:
2025-06-05 13:24:43 +01:00
parent 7f1b790688
commit 1293aa0fdf
3 changed files with 13 additions and 16 deletions
+4 -4
View File
@@ -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
+1 -4
View File
@@ -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
+8 -8
View File
@@ -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