Cleanup module pathing

This commit is contained in:
2022-07-27 17:37:18 +01:00
parent b52adddd5d
commit 8aa5c17ab9
27 changed files with 484 additions and 517 deletions
+53 -55
View File
@@ -1,55 +1,19 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Prop
where
import GHC.Generics
import Data.Aeson
import Dodge.Data.WorldEffect
import Shape.Data
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Prop where
import Color
import qualified Quaternion as Q
import Geometry.Data
import ShapePicture.Data
import Control.Lens
data PropDraw = PropDrawSPic SPic
| PropDrawMovingShapeCol Shape
| PropDrawMovingShape PropDraw
| PropDrawFlatTranslate PropDraw
| PropDoubleLampCover Float
| PropVerticalLampCover Float
| PropLampCover Float
| PropDrawToggle PropDraw
| PropDrawGib Float
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON PropDraw where
toEncoding = genericToEncoding defaultOptions
instance FromJSON PropDraw
data PropUpdate -- = UpdatePropZ
= PropUpdateAnd PropUpdate PropUpdate
-- | UpdateShapeProp
| PropFallSmallBounceDamage
| PropFallSmallBounce
| PropUpdateId
| PropRotate Float
| PropSetToggleAnd WdBl PropUpdate
| PropUpdates [PropUpdate]
| PropUpdateLS Int PrWdLsLs -- Prop -> World -> LightSource -> LightSource
| PropUpdatePosition WdP2f
| PropUpdateWhen WdBl PropUpdate
| PropUpdateIf WdBl PropUpdate PropUpdate
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON PropUpdate where
toEncoding = genericToEncoding defaultOptions
instance FromJSON PropUpdate
data PrWdLsLs = PrWdLsId
| PrWdLsSetPosition WdP2f Point3
| PrWdLsSetColor Point3
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON PrWdLsLs where
toEncoding = genericToEncoding defaultOptions
instance FromJSON PrWdLsLs
data Prop
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.WorldEffect
import Geometry.Data
import qualified Quaternion as Q
import Shape.Data
import ShapePicture.Data
data Prop
= PropZ
{ _prPos :: Point2
, _prDraw :: PropDraw
@@ -60,8 +24,8 @@ data Prop
, _prPosZ :: Float
, _prVelZ :: Float
, _prTimer :: Int
, _prQuat :: Q.Quaternion Float
, _prQuatSpin :: Q.Quaternion Float
, _prQuat :: Q.Quaternion Float
, _prQuatSpin :: Q.Quaternion Float
, _prColor :: Color
}
| ShapeProp
@@ -72,8 +36,42 @@ data Prop
, _prRot :: Float
, _prToggle :: Bool
}
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Prop where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Prop
deriving (Eq, Ord, Show, Read)
data PropDraw
= PropDrawSPic SPic
| PropDrawMovingShapeCol Shape
| PropDrawMovingShape PropDraw
| PropDrawFlatTranslate PropDraw
| PropDoubleLampCover Float
| PropVerticalLampCover Float
| PropLampCover Float
| PropDrawToggle PropDraw
| PropDrawGib Float
deriving (Eq, Ord, Show, Read)
data PropUpdate
= PropUpdateAnd PropUpdate PropUpdate
| PropFallSmallBounceDamage
| PropFallSmallBounce
| PropUpdateId
| PropRotate Float
| PropSetToggleAnd WdBl PropUpdate
| PropUpdates [PropUpdate]
| PropUpdateLS Int PrWdLsLs
| PropUpdatePosition WdP2f
| PropUpdateWhen WdBl PropUpdate
| PropUpdateIf WdBl PropUpdate PropUpdate
deriving (Eq, Ord, Show, Read)
data PrWdLsLs
= PrWdLsId
| PrWdLsSetPosition WdP2f Point3
| PrWdLsSetColor Point3
deriving (Eq, Ord, Show, Read)
makeLenses ''Prop
deriveJSON defaultOptions ''PropDraw
deriveJSON defaultOptions ''PropUpdate
deriveJSON defaultOptions ''PrWdLsLs
deriveJSON defaultOptions ''Prop